Closed jbush001 closed 5 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.
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).