[Lldb-commits] [lldb] [lldb-dap] Fix flaky TestDAP_stopped_events.py (PR #179689)
Ebuka Ezike via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 4 07:34:39 PST 2026
https://github.com/da-viper created https://github.com/llvm/llvm-project/pull/179689
We are waiting for both stopped event at once.
We may not get both events within the (0.25 seconds) time interval to fetch more events. Retry with the `DEFAULT TIMEOUT` if we got one of the event.
Increase the `EVENT_QUIET_PERIOD`'s value for ASAN mode
Fixes #179648
>From eead09b609a34337e3794ea57af7cd648a92efc6 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Wed, 4 Feb 2026 14:26:15 +0000
Subject: [PATCH] [lldb-dap] Fix flaky TestDAP_stopped_events.py
We are waiting for both stopped event at once.
We may not get both within the (0.25 seconds) time interval to fetch more
events. Retry with the `DEFAULT TIMEOUT` if we got one of the event.
Increase the value `EVENT_QUIET_PERIOD` for ASAN mode
---
.../Python/lldbsuite/test/tools/lldb-dap/dap_server.py | 2 +-
.../tools/lldb-dap/stopped-events/TestDAP_stopped_events.py | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 32e37c502e358..8ce6608faa45c 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -44,7 +44,7 @@
# A quiet period between events, used to determine if we're done receiving
# events in a given window, otherwise 'wait_for_stopped' would need to wait
# until the DEFAULT_TIMEOUT occurs, slows down tests significantly.
-EVENT_QUIET_PERIOD = 0.25
+EVENT_QUIET_PERIOD = 0.25 * (20.0 if ("ASAN_OPTIONS" in os.environ) else 1.0)
# See lldbtest.Base.spawnSubprocess, which should help ensure any processes
diff --git a/lldb/test/API/tools/lldb-dap/stopped-events/TestDAP_stopped_events.py b/lldb/test/API/tools/lldb-dap/stopped-events/TestDAP_stopped_events.py
index 03dff39c82ed9..8b7f612c5f4a7 100644
--- a/lldb/test/API/tools/lldb-dap/stopped-events/TestDAP_stopped_events.py
+++ b/lldb/test/API/tools/lldb-dap/stopped-events/TestDAP_stopped_events.py
@@ -46,6 +46,11 @@ def test_multiple_threads_sample_breakpoint(self):
[bp] = self.set_source_breakpoints("main.cpp", [line])
events = self.continue_to_next_stop()
+ if len(events) == 1:
+ # we may not catch both events at the same time if we run with sanitizers
+ # enabled or on slow or heavily used computer.
+ events.extend(self.continue_to_next_stop())
+
self.assertEqual(len(events), 2, "Expected exactly two 'stopped' events")
for event in events:
body = event["body"]
More information about the lldb-commits
mailing list