We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fa2665 commit 10aab78Copy full SHA for 10aab78
Tests/AllocatedLockTests.swift
@@ -58,18 +58,18 @@ final class AllocatedLockTests: XCTestCase {
58
59
func testLock_Blocks() async {
60
let lock = AllocatedLock()
61
+ await MainActor.run {
62
+ lock.unsafeLock()
63
+ }
64
65
Task { @MainActor in
- lock.unsafeLock()
- try? await Task.sleep(nanoseconds: 1_000_000_000)
66
+ try? await Task.sleep(nanoseconds: 200_000)
67
lock.unsafeUnlock()
68
}
69
- try? await Task.sleep(nanoseconds: 500_000)
-
70
let results = await withTaskGroup(of: Bool.self) { group in
71
group.addTask {
72
- try? await Task.sleep(nanoseconds: 5_000_000)
+ try? await Task.sleep(nanoseconds: 10_000)
73
return true
74
75
0 commit comments