[Lldb-commits] [lldb] 56fb745 - [lldb/test] Increase pexpect termination timeouts

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 22 07:14:33 PDT 2022


Author: Pavel Labath
Date: 2022-03-22T15:14:21+01:00
New Revision: 56fb7456950d2564d16500e40c5719c954a6987a

URL: https://github.com/llvm/llvm-project/commit/56fb7456950d2564d16500e40c5719c954a6987a
DIFF: https://github.com/llvm/llvm-project/commit/56fb7456950d2564d16500e40c5719c954a6987a.diff

LOG: [lldb/test] Increase pexpect termination timeouts

By default these timeouts are extremely small (0.1s). This means that
100ms after sending an EOF, pexpect will start sending the process
increasingly aggressive signals, but the small timeouts mean that (on a
loaded machine) the kernel may not have enough time to process the
signal even if the overall effect of the signal is to kill the
application.

It turns out we were already relying on this signals (instead of regular
EOF quits) in our tests. In my experiments it was sufficient to block
SIGINT and SIGHUP to cause some test to become flaky. This was most
likely the reason of a couple of flakes on the lldb-x86_64-debian bot,
and is probably the reason why the pexpect tests are flaky on several
other (e.g. asan) bots.

This patch increses the timeout to 6 seconds (60-fold increase), which
is hopefully sufficient to avoid flakes even in the most extreme
situations.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
index 84a0d61d8bddb..de8f819e2552a 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
@@ -47,6 +47,8 @@ def launch(self, executable=None, extra_args=None, timeout=60,
         self.child = pexpect.spawn(
                 args[0], args=args[1:], logfile=logfile,
                 timeout=timeout, dimensions=dimensions, env=env)
+        self.child.ptyproc.delayafterclose = timeout/10
+        self.child.ptyproc.delayafterterminate = timeout/10
 
         if post_spawn is not None:
             post_spawn()


        


More information about the lldb-commits mailing list