Skip to content

Commit e054712

Browse files
authored
[lldb] Deflake TestDAP_attach (llvm#108226)
The test failed in <https://lab.llvm.org/buildbot/#/builders/162/builds/5785> due to frame variable not being in stop commands, even though the DAP log shows the command being present there. I'm pretty sure this is a race in the test the collection of the test log. I fix that by making sure we wait for the expected output, and also by increasing the timeout (1s is cutting it very close). The arm failure link is no longer functional, but I'm fairly certain that this was the cause of those flakes as well.
1 parent 069b841 commit e054712

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ def test_by_name_waitFor(self):
116116

117117
@skipIfDarwin
118118
@skipIfNetBSD # Hangs on NetBSD as well
119-
@skipIf(
120-
archs=["arm", "aarch64"]
121-
) # Example of a flaky run http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/5527/steps/test/logs/stdio
122119
def test_commands(self):
123120
"""
124121
Tests the "initCommands", "preRunCommands", "stopCommands",
@@ -152,7 +149,7 @@ def test_commands(self):
152149
initCommands = ["target list", "platform list"]
153150
preRunCommands = ["image list a.out", "image dump sections a.out"]
154151
postRunCommands = ["help trace", "help process trace"]
155-
stopCommands = ["frame variable", "bt"]
152+
stopCommands = ["frame variable", "thread backtrace"]
156153
exitCommands = ["expr 2+3", "expr 3+4"]
157154
terminateCommands = ["expr 4+2"]
158155
self.attach(
@@ -179,7 +176,7 @@ def test_commands(self):
179176
breakpoint_ids = self.set_function_breakpoints(functions)
180177
self.assertEqual(len(breakpoint_ids), len(functions), "expect one breakpoint")
181178
self.continue_to_breakpoints(breakpoint_ids)
182-
output = self.get_console(timeout=1.0)
179+
output = self.collect_console(timeout_secs=10, pattern=stopCommands[-1])
183180
self.verify_commands("stopCommands", output, stopCommands)
184181

185182
# Continue after launch and hit the "pause()" call and stop the target.
@@ -189,7 +186,7 @@ def test_commands(self):
189186
time.sleep(0.5)
190187
self.dap_server.request_pause()
191188
self.dap_server.wait_for_stopped()
192-
output = self.get_console(timeout=1.0)
189+
output = self.collect_console(timeout_secs=10, pattern=stopCommands[-1])
193190
self.verify_commands("stopCommands", output, stopCommands)
194191

195192
# Continue until the program exits
@@ -198,7 +195,7 @@ def test_commands(self):
198195
# "exitCommands" that were run after the second breakpoint was hit
199196
# and the "terminateCommands" due to the debugging session ending
200197
output = self.collect_console(
201-
timeout_secs=1.0,
198+
timeout_secs=10.0,
202199
pattern=terminateCommands[0],
203200
)
204201
self.verify_commands("exitCommands", output, exitCommands)

0 commit comments

Comments
 (0)