From bb4efab9a4d9431dbedb27f04249effd0a73812e Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Fri, 14 Aug 2020 13:12:12 +0200 Subject: [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. --- lldb/test/API/python_api/target/TestTargetAPI.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lldb/test/API/python_api') diff --git a/lldb/test/API/python_api/target/TestTargetAPI.py b/lldb/test/API/python_api/target/TestTargetAPI.py index de8bed0..85a6d78 100644 --- a/lldb/test/API/python_api/target/TestTargetAPI.py +++ b/lldb/test/API/python_api/target/TestTargetAPI.py @@ -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, "") -- cgit v1.1