forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
fdc6aea3fd
commit
bb4efab9a4
|
@ -168,7 +168,7 @@ class TargetAPITestCase(TestBase):
|
|||
|
||||
process = target.LaunchSimple(
|
||||
['foo', 'bar'], ['baz'], self.get_process_working_directory())
|
||||
self.runCmd("run")
|
||||
process.Continue()
|
||||
self.assertEqual(process.GetState(), lldb.eStateExited)
|
||||
output = process.GetSTDOUT(9999)
|
||||
self.assertIn('arg: foo', output)
|
||||
|
@ -179,7 +179,7 @@ class TargetAPITestCase(TestBase):
|
|||
self.runCmd("setting set target.env-vars bar=baz")
|
||||
process = target.LaunchSimple(None, None,
|
||||
self.get_process_working_directory())
|
||||
self.runCmd("run")
|
||||
process.Continue()
|
||||
self.assertEqual(process.GetState(), lldb.eStateExited)
|
||||
output = process.GetSTDOUT(9999)
|
||||
self.assertIn('arg: foo', output)
|
||||
|
@ -188,7 +188,7 @@ class TargetAPITestCase(TestBase):
|
|||
self.runCmd("settings set target.disable-stdio true")
|
||||
process = target.LaunchSimple(
|
||||
None, None, self.get_process_working_directory())
|
||||
self.runCmd("run")
|
||||
process.Continue()
|
||||
self.assertEqual(process.GetState(), lldb.eStateExited)
|
||||
output = process.GetSTDOUT(9999)
|
||||
self.assertEqual(output, "")
|
||||
|
|
Loading…
Reference in New Issue