[Lldb-commits] [PATCH] D60563: [pexepect] Add a small sleep between pexect calls

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 11 04:32:27 PDT 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: labath, davide.
Herald added a project: LLDB.

When we upgraded pexpect to a more recent version, we experienced issues where pexpect was sending commands faster to LLDB could process. The problem was especially apparent on CI systems, where the high load caused LLDB to be inevitable more constrained. Usually the issue would go away when running the test by itself and would reappear when running multiple tests concurrently.

When we looked at this, the pexecpt implementation already contains a small timeout. Apparently that sometimes wasn't sufficient for LLDB.

Rather than adding timeouts in the affected tests, I would propose to just do it in lldbpexpect.py. It's definitely not the best solution, but it does solve the flakiness issues I'm investigating.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D60563

Files:
  lldb/packages/Python/lldbsuite/test/lldbpexpect.py


Index: lldb/packages/Python/lldbsuite/test/lldbpexpect.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbpexpect.py
+++ lldb/packages/Python/lldbsuite/test/lldbpexpect.py
@@ -4,6 +4,7 @@
 # System modules
 import os
 import sys
+import time
 
 # Third-party modules
 import six
@@ -46,6 +47,7 @@
                 timeout = self.timeout
             if exact is None:
                 exact = False
+            time.sleep(0.1) # Give LLDB time to process
             if exact:
                 return self.child.expect_exact(patterns, timeout=timeout)
             else:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60563.194661.patch
Type: text/x-patch
Size: 637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190411/b137d0f2/attachment.bin>


More information about the lldb-commits mailing list