Skip to content

Commit 97242b7

Browse files
author
kendal
committed
Fix flake in TestZerothFrame.py
This test is relying on the order of `process.threads` which is nondeterministic. By switching from `process.GetThreadAtIndex` to `process.GetThreadByIndex` we consistently retrieve the correct thread.
1 parent c579020 commit 97242b7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lldb/test/API/functionalities/unwind/zeroth_frame/TestZerothFrame.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ def test(self):
5353
process = target.LaunchSimple(None, None, self.get_process_working_directory())
5454
self.assertTrue(process, VALID_PROCESS)
5555

56-
thread = process.GetThreadAtIndex(0)
56+
thread = process.GetThreadByIndexID(1)
5757
if self.TraceOn():
5858
print("Backtrace at the first breakpoint:")
5959
for f in thread.frames:
6060
print(f)
61+
6162
# Check that we have stopped at correct breakpoint.
6263
self.assertEqual(
63-
process.GetThreadAtIndex(0).frame[0].GetLineEntry().GetLine(),
64+
thread.frame[0].GetLineEntry().GetLine(),
6465
bp1_line,
6566
"LLDB reported incorrect line number.",
6667
)
@@ -70,7 +71,7 @@ def test(self):
7071
# 'continue' command.
7172
process.Continue()
7273

73-
thread = process.GetThreadAtIndex(0)
74+
thread = process.GetThreadByIndexID(1)
7475
if self.TraceOn():
7576
print("Backtrace at the second breakpoint:")
7677
for f in thread.frames:

0 commit comments

Comments
 (0)