Skip to content

Commit 10aab78

Browse files
committed
Speed up test
1 parent 0fa2665 commit 10aab78

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Tests/AllocatedLockTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@ final class AllocatedLockTests: XCTestCase {
5858

5959
func testLock_Blocks() async {
6060
let lock = AllocatedLock()
61+
await MainActor.run {
62+
lock.unsafeLock()
63+
}
6164

6265
Task { @MainActor in
63-
lock.unsafeLock()
64-
try? await Task.sleep(nanoseconds: 1_000_000_000)
66+
try? await Task.sleep(nanoseconds: 200_000)
6567
lock.unsafeUnlock()
6668
}
6769

68-
try? await Task.sleep(nanoseconds: 500_000)
69-
7070
let results = await withTaskGroup(of: Bool.self) { group in
7171
group.addTask {
72-
try? await Task.sleep(nanoseconds: 5_000_000)
72+
try? await Task.sleep(nanoseconds: 10_000)
7373
return true
7474
}
7575
group.addTask {

0 commit comments

Comments
 (0)