Skip to content

Commit 82c1bfc

Browse files
Increase timeout to reduce test failure rate. (#83312)
The timeout for this test was set to 1.0s which is very low, it should be a default of 10s and be increased by a factor of 10 if ASAN is enabled. This will help reduce the falkiness of the test, especially in ASAN builds.
1 parent 8157847 commit 82c1bfc

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77

88
class DAPTestCaseBase(TestBase):
9+
# set timeout based on whether ASAN was enabled or not. Increase
10+
# timeout by a factor of 10 if ASAN is enabled.
11+
timeoutval = 10 * (10 if ('ASAN_OPTIONS' in os.environ) else 1)
912
NO_DEBUG_INFO_TESTCASE = True
1013

1114
def create_debug_adaptor(self, lldbDAPEnv=None):

lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_termination(self):
4444
self.dap_server.request_disconnect()
4545

4646
# Wait until the underlying lldb-dap process dies.
47-
self.dap_server.process.wait(timeout=10)
47+
self.dap_server.process.wait(timeout=lldbdap_testcase.DAPTestCaseBase.timeoutval)
4848

4949
# Check the return code
5050
self.assertEqual(self.dap_server.process.poll(), 0)
@@ -334,14 +334,14 @@ def test_commands(self):
334334
# Get output from the console. This should contain both the
335335
# "stopCommands" that were run after the first breakpoint was hit
336336
self.continue_to_breakpoints(breakpoint_ids)
337-
output = self.get_console(timeout=1.0)
337+
output = self.get_console(timeout=lldbdap_testcase.DAPTestCaseBase.timeoutval)
338338
self.verify_commands("stopCommands", output, stopCommands)
339339

340340
# Continue again and hit the second breakpoint.
341341
# Get output from the console. This should contain both the
342342
# "stopCommands" that were run after the second breakpoint was hit
343343
self.continue_to_breakpoints(breakpoint_ids)
344-
output = self.get_console(timeout=1.0)
344+
output = self.get_console(timeout=lldbdap_testcase.DAPTestCaseBase.timeoutval)
345345
self.verify_commands("stopCommands", output, stopCommands)
346346

347347
# Continue until the program exits
@@ -402,21 +402,21 @@ def test_extra_launch_commands(self):
402402
self.verify_commands("launchCommands", output, launchCommands)
403403
# Verify the "stopCommands" here
404404
self.continue_to_next_stop()
405-
output = self.get_console(timeout=1.0)
405+
output = self.get_console(timeout=lldbdap_testcase.DAPTestCaseBase.timeoutval)
406406
self.verify_commands("stopCommands", output, stopCommands)
407407

408408
# Continue and hit the second breakpoint.
409409
# Get output from the console. This should contain both the
410410
# "stopCommands" that were run after the first breakpoint was hit
411411
self.continue_to_next_stop()
412-
output = self.get_console(timeout=1.0)
412+
output = self.get_console(timeout=lldbdap_testcase.DAPTestCaseBase.timeoutval)
413413
self.verify_commands("stopCommands", output, stopCommands)
414414

415415
# Continue until the program exits
416416
self.continue_to_exit()
417417
# Get output from the console. This should contain both the
418418
# "exitCommands" that were run after the second breakpoint was hit
419-
output = self.get_console(timeout=1.0)
419+
output = self.get_console(timeout=lldbdap_testcase.DAPTestCaseBase.timeoutval)
420420
self.verify_commands("exitCommands", output, exitCommands)
421421

422422
@skipIfWindows

0 commit comments

Comments
 (0)