Skip to content

Commit b67cf24

Browse files
Stabilize identity GC test
1 parent 1db28fd commit b67cf24

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Tests/BridgeJSIdentityTests/IdentityModeTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ final class IdentityModeTests: XCTestCase {
3838
// let FinalizationRegistry fire and call deinit.
3939
for _ in 0..<100 {
4040
try gc()
41-
try await Task.sleep(for: .milliseconds(0))
41+
// Give the JS runtime an actual turn so FinalizationRegistry callbacks
42+
// can run before we check the Swift weak reference.
43+
try await Task.sleep(for: .milliseconds(1))
4244
if weakSubject == nil {
4345
break
4446
}

0 commit comments

Comments
 (0)