From 56fb7456950d2564d16500e40c5719c954a6987a Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 22 Mar 2022 14:52:02 +0100 Subject: [PATCH] [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. --- lldb/packages/Python/lldbsuite/test/lldbpexpect.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py index 84a0d61..de8f819 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py +++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py @@ -47,6 +47,8 @@ class PExpectTest(TestBase): 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() -- 2.7.4