summaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/interactive_scripted_process/TestInteractiveScriptedProcess.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/API/functionalities/interactive_scripted_process/TestInteractiveScriptedProcess.py')
-rw-r--r--lldb/test/API/functionalities/interactive_scripted_process/TestInteractiveScriptedProcess.py35
1 files changed, 23 insertions, 12 deletions
diff --git a/lldb/test/API/functionalities/interactive_scripted_process/TestInteractiveScriptedProcess.py b/lldb/test/API/functionalities/interactive_scripted_process/TestInteractiveScriptedProcess.py
index 6c531550c95e..528c9fdce69c 100644
--- a/lldb/test/API/functionalities/interactive_scripted_process/TestInteractiveScriptedProcess.py
+++ b/lldb/test/API/functionalities/interactive_scripted_process/TestInteractiveScriptedProcess.py
@@ -22,8 +22,10 @@ class TestInteractiveScriptedProcess(TestBase):
self.script_module = "interactive_scripted_process"
self.script_file = self.script_module + ".py"
+ # These tests are flakey and sometimes timeout. They work most of the time
+ # so the basic event flow is right, but somehow the handling is off.
@skipUnlessDarwin
- @skipIfDarwin
+ @skipIfDarwin
def test_passthrough_launch(self):
"""Test a simple pass-through process launch"""
self.passthrough_launch()
@@ -35,6 +37,15 @@ class TestInteractiveScriptedProcess(TestBase):
self.assertTrue(self.mux_process.IsValid(), "Got a valid process")
event = lldbutil.fetch_next_event(
+ self, self.dbg.GetListener(), self.mux_process.GetBroadcaster(), timeout=20
+ )
+ self.assertState(lldb.SBProcess.GetStateFromEvent(event), lldb.eStateRunning)
+ event = lldbutil.fetch_next_event(
+ self, self.dbg.GetListener(), self.mux_process.GetBroadcaster()
+ )
+ self.assertState(lldb.SBProcess.GetStateFromEvent(event), lldb.eStateStopped)
+
+ event = lldbutil.fetch_next_event(
self, self.mux_process_listener, self.mux_process.GetBroadcaster()
)
self.assertState(lldb.SBProcess.GetStateFromEvent(event), lldb.eStateRunning)
@@ -178,6 +189,13 @@ class TestInteractiveScriptedProcess(TestBase):
)
execution_events[event_target_idx][state] = True
+ for _ in range((self.dbg.GetNumTargets() - 1) * 2):
+ fetch_process_event(self, execution_events)
+
+ for target_index, event_states in execution_events.items():
+ for state, is_set in event_states.items():
+ self.assertTrue(is_set, f"Target {target_index} has state {state} set")
+
event = lldbutil.fetch_next_event(
self, self.mux_process_listener, self.mux_process.GetBroadcaster()
)
@@ -188,13 +206,6 @@ class TestInteractiveScriptedProcess(TestBase):
)
self.assertState(lldb.SBProcess.GetStateFromEvent(event), lldb.eStateStopped)
- for _ in range((self.dbg.GetNumTargets() - 1) * 2):
- fetch_process_event(self, execution_events)
-
- for target_index, event_states in execution_events.items():
- for state, is_set in event_states.items():
- self.assertTrue(is_set, f"Target {target_index} has state {state} set")
-
def duplicate_target(self, driving_target):
exe = driving_target.executable.fullpath
triple = driving_target.triple
@@ -248,14 +259,14 @@ class TestInteractiveScriptedProcess(TestBase):
self.assertSuccess(error, "Launched multiplexer scripted process")
self.assertTrue(self.mux_process.IsValid(), "Got a valid process")
- # Check that the mux process started running
+ # Check that the real process started running
event = lldbutil.fetch_next_event(
- self, self.mux_process_listener, self.mux_process.GetBroadcaster()
+ self, self.dbg.GetListener(), self.mux_process.GetBroadcaster()
)
self.assertState(lldb.SBProcess.GetStateFromEvent(event), lldb.eStateRunning)
- # Check that the real process started running
+ # Check that the mux process started running
event = lldbutil.fetch_next_event(
- self, self.dbg.GetListener(), self.mux_process.GetBroadcaster()
+ self, self.mux_process_listener, self.mux_process.GetBroadcaster()
)
self.assertState(lldb.SBProcess.GetStateFromEvent(event), lldb.eStateRunning)