The --testTimeOut sets a limit in seconds to kill a test if it exceeds the limit. We never got this working and we rely on buildbot to kill the run it exceeds 5m. In runtestBase.py we do: p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out,err)=p.communicate() - communicate blocks until the process finishes and causes runtests.py to hang if a test never ends I think a better solution is to use polling with memory buffers and avoid communicate. outFile=tempFile.spooledTemporaryFile() errFile=tempFile.spooledTemporaryFile() p = subprocess.Popen(cmd, stdout=outFile, stderr=errFile) while True: if p.poll!=None: break if time()-start>self.testTimeOut: p.terminate() break sleep(.05) # switches to other threads out=outFile.read() err=errFile.read()
See Also: → bug 525089
Created attachment 569370 [details] [diff] [review] patch
I think I see a minor speedup because we are not using communicate() and using the in memory temp file seems fast. If timeout occurs the code tries to call terminate() to kill the process. The code sleeps 1s, checks if the process is still running, and retries up to 10 times. If the script cannot kill the process maybe an exception should be thrown and the script should stop. I'm not sure if we should bail on the test run or just keep running registering a failure. I should make a minor change to the patch to gracefully handle the situation. Currently the code will thrown an exception because p.poll() returns None. Hopefully terminate() works consistently and we can always terminiate the process.
will this also work with run-acceptance-generic-adb.sh? how about ssh?
Comment on attachment 569370 [details] [diff] [review] patch Review of attachment 569370 [details] [diff] [review]: ----------------------------------------------------------------- Removing review request as this patch appears to have landed via bug 706071, tamarin-redux 6754:b442a94598f0
You need to log in before you can comment on or make changes to this bug.