[Lldb-commits] [PATCH] D13362: Enhance test runner timeout logic to detect successful completion of spawned process when stdout/stderr are shared to still-existing child processes

Todd Fiala via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 1 13:12:17 PDT 2015


tfiala created this revision.
tfiala added reviewers: labath, zturner.
tfiala added a subscriber: lldb-commits.

This makes one of the internal process_control tests go green.  It covers the case where spawned process P1 itself spawns a child process C1, shared stdout/stderr file handles with C1, and then P1 terminates.

Prior to this change, we would end up timing out rather than detecting the immediate termination of P1 because we would wait for the stdout/stderr file handles to wrap up.

Now we wait on a condition variable that is set via a thread parked on subprocess.Popen.wait() and another on subprocess.Popen.communicate().  This allows us to catch the scenario above.  There's an additional thread (for the thread parked on wait()).  Both the wait() and the communicate() threads wait efficiently, so this should be minimal cost. 

http://reviews.llvm.org/D13362

Files:
  test/test_runner/lib/process_control.py
  test/test_runner/test/inferior.py
  test/test_runner/test/process_control_tests.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13362.36287.patch
Type: text/x-patch
Size: 24567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151001/495234b8/attachment-0001.bin>


More information about the lldb-commits mailing list