[Lldb-commits] [PATCH] D64546: [lldb] Make TestDeletedExecutable more reliable

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 10 22:52:29 PDT 2019


teemperor created this revision.
teemperor added a reviewer: davide.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

It seems that calling Popen can return to the caller before the started process has read all the needed information
from its executable. This means that in case we delete the executable while the process is still starting up,
this test will create a zombie process which in turn leads to a failing test. On my macOS system this happens quite frequently.

The startup time for this process is really short, so waiting half a second before deleting the executable seems to be
long enough to make this test pass consistently.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64546

Files:
  lldb/packages/Python/lldbsuite/test/functionalities/deleted-executable/TestDeletedExecutable.py


Index: lldb/packages/Python/lldbsuite/test/functionalities/deleted-executable/TestDeletedExecutable.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/functionalities/deleted-executable/TestDeletedExecutable.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/deleted-executable/TestDeletedExecutable.py
@@ -26,6 +26,8 @@
 
         popen = self.spawnSubprocess(exe)
         self.addTearDownHook(self.cleanupSubprocesses)
+        # Give the process some time to start.
+        time.sleep(0.5)
         os.remove(exe)
 
         self.runCmd("process attach -p " + str(popen.pid))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64546.209125.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190711/8072718d/attachment.bin>


More information about the lldb-commits mailing list