Skip to content

Commit 0335696

Browse files
committed
[lldb] Make TestSwiftActorUnprioritisedJobs deterministic
1 parent e606ddd commit 0335696

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
class TestCase(TestBase):
88

99
@swiftTest
10-
@skipUnlessFoundation
11-
@skipIfWindows # temporarily skip test until fails can be investigated
12-
@skipIfLinux # temporarily skip test until fails can be investigated
13-
@skipIfDarwin # temporarily skip test until fails can be investigated
1410
def test_actor_unprioritised_jobs(self):
1511
"""Verify that an actor exposes its unprioritised jobs (queue)."""
1612
self.build()
@@ -19,12 +15,11 @@ def test_actor_unprioritised_jobs(self):
1915
)
2016
frame = thread.GetSelectedFrame()
2117
defaultActor = frame.var("a.$defaultActor")
22-
self.assertEqual(defaultActor.summary, "running")
2318
unprioritised_jobs = defaultActor.GetChildMemberWithName("unprioritised_jobs")
2419
# There are 4 child tasks (async let), the first one occupies the actor
2520
# with a sleep, the next 3 go on to the queue.
26-
# TODO: rdar://148377173
27-
# self.assertEqual(unprioritised_jobs.num_children, 3)
21+
self.assertEqual(unprioritised_jobs.num_children, 3)
22+
self.assertEqual(defaultActor.summary, "running")
2823
for job in unprioritised_jobs:
2924
self.assertRegex(job.name, r"^\d+")
3025
self.assertRegex(job.summary, r"^id:\d+ flags:\S+")

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import Foundation
2-
31
actor Actor {
42
var data: Int = 15
53

64
func occupy() async {
7-
Thread.sleep(forTimeInterval: 100)
5+
_ = readLine()
86
}
97

108
func work() async -> Int {

0 commit comments

Comments
 (0)