jbush001 / NyuziProcessor

GPGPU microprocessor architecture
Apache License 2.0
1.97k stars 349 forks source link

Remove test_harness.TimedProcessRunner #139

Closed jbush001 closed 5 years ago

jbush001 commented 6 years ago

In python2, the only way to cause a timeout if a subprocess took too long was to spawn a thread to kill it. The TimedProcessRunner did this. In python 3, there is now a 'timeout' parameter to subprocess.communicate. TimedProcessRunner can probably be eliminated and replaced with that (perhaps with a simpler wrapper to capture the native exception and throw a TestException).

jbush001 commented 6 years ago

cpython code for timeout is here.

One side effect of this change may be that it would not kill the process cleanly. The code in test_harness currently attempts to send a break signal before terminating the process so the emulator can clean up. Specifically, it needs to restore the terminal state. Perhaps the test harness could do that instead.