Skip to content

Commit 2eaa752

Browse files
test: need to wrap in DispatchQueue
1 parent 442a358 commit 2eaa752

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExampleUITests/FirebaseSwiftUIExampleUITests.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ final class FirebaseSwiftUIExampleUITests: XCTestCase {
8888
let maxWaitTime: TimeInterval = 30
8989

9090
Timer.scheduledTimer(withTimeInterval: checkInterval, repeats: true) { timer in
91-
if signedInText.exists {
92-
expectation.fulfill()
93-
timer.invalidate()
91+
DispatchQueue.main.async {
92+
if signedInText.exists {
93+
expectation.fulfill()
94+
timer.invalidate()
95+
}
9496
}
9597
}
9698

@@ -195,9 +197,11 @@ final class FirebaseSwiftUIExampleUITests: XCTestCase {
195197
let maxWaitTime: TimeInterval = 30
196198

197199
Timer.scheduledTimer(withTimeInterval: checkInterval, repeats: true) { timer in
198-
if signedInText.exists {
199-
expectation.fulfill()
200-
timer.invalidate()
200+
DispatchQueue.main.async {
201+
if signedInText.exists {
202+
expectation.fulfill()
203+
timer.invalidate()
204+
}
201205
}
202206
}
203207

0 commit comments

Comments
 (0)