Skip to content

Commit e7d3bf0

Browse files
committed
New approach did not work, restore previous
1 parent 6288b40 commit e7d3bf0

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

lldb/test/API/lang/swift/async/actors/unprioritised_jobs/TestSwiftActorUnprioritisedJobs.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@ def test_actor_unprioritised_jobs(self):
2222
"""Verify that an actor exposes its unprioritised jobs (queue)."""
2323
self.build()
2424
_, process, thread, _ = lldbutil.run_to_source_breakpoint(
25-
self,
26-
"break here",
27-
lldb.SBFileSpec("main.swift"),
28-
only_one_thread=False,
25+
self, "break here", lldb.SBFileSpec("main.swift")
2926
)
3027

31-
stopped_threads = [
32-
t for t in process.threads if t.stop_reason == lldb.eStopReasonBreakpoint
33-
]
34-
35-
# If only one breakpoint has hit, run the other threads to reach the
36-
# state where both breakpoints have hit.
37-
if len(stopped_threads) == 1:
38-
with _managed_async(self.dbg):
39-
# Suspend the current thread.
40-
thread.Suspend()
41-
# Run the other threads until the second breakpoint hits.
42-
self.dbg.SetAsync(False)
43-
process.Continue()
28+
with _managed_async(self.dbg):
29+
# Suspend the current thread.
30+
thread.Suspend()
31+
# Continue - other threads only.
32+
self.dbg.SetAsync(True)
33+
process.Continue()
34+
# Wait - allowing other threads to run.
35+
time.sleep(5)
36+
# Stop the threads.
37+
self.dbg.SetAsync(False)
38+
self.dbg.HandleCommand("process interrupt")
39+
# Note: After a single interrupt, lldb reports the process as
40+
# running, but two interrupt calls results in a stopped process.
41+
# Also, using `process.Stop()` instead of `"process interrupt"`
42+
# did not work.
43+
self.dbg.HandleCommand("process interrupt")
4444

4545
# Get the frame for the the breakpoint hit in `main()`.
4646
frame = lldb.SBFrame()

lldb/test/API/lang/swift/async/actors/unprioritised_jobs/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ actor Actor {
22
var data: Int = 15
33

44
func occupy() async {
5-
print("break here")
5+
_ = readLine()
66
}
77

88
func work() async -> Int {

0 commit comments

Comments
 (0)