Skip to content

Commit bb4efab

Browse files
committed
[lldb] Use SBProcess::Continue instead of 'run' command in TestTargetAPI.py
This test is flaky on Green Dragon as it often fails when the process state is "Invalid" in the assert: self.assertEqual(process.GetState(), lldb.eStateExited) It seems this is related to just doing "run" which apparently invalidates the Target's process in case it's still running and needs to be restarted. Just doing 'continue' on the process (and ignoring the error in case it already finished) prevents that and makes this consistently pass for me. Just pushing this out to get Green Dragon back online.
1 parent fdc6aea commit bb4efab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lldb/test/API/python_api/target/TestTargetAPI.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_launch_simple(self):
168168

169169
process = target.LaunchSimple(
170170
['foo', 'bar'], ['baz'], self.get_process_working_directory())
171-
self.runCmd("run")
171+
process.Continue()
172172
self.assertEqual(process.GetState(), lldb.eStateExited)
173173
output = process.GetSTDOUT(9999)
174174
self.assertIn('arg: foo', output)
@@ -179,7 +179,7 @@ def test_launch_simple(self):
179179
self.runCmd("setting set target.env-vars bar=baz")
180180
process = target.LaunchSimple(None, None,
181181
self.get_process_working_directory())
182-
self.runCmd("run")
182+
process.Continue()
183183
self.assertEqual(process.GetState(), lldb.eStateExited)
184184
output = process.GetSTDOUT(9999)
185185
self.assertIn('arg: foo', output)
@@ -188,7 +188,7 @@ def test_launch_simple(self):
188188
self.runCmd("settings set target.disable-stdio true")
189189
process = target.LaunchSimple(
190190
None, None, self.get_process_working_directory())
191-
self.runCmd("run")
191+
process.Continue()
192192
self.assertEqual(process.GetState(), lldb.eStateExited)
193193
output = process.GetSTDOUT(9999)
194194
self.assertEqual(output, "")

0 commit comments

Comments
 (0)