aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/Integration
diff options
context:
space:
mode:
authorGravatar Sebastian Schmidt <mrschmidt@google.com>2018-01-05 10:34:38 -0800
committerGravatar Sebastian Schmidt <mrschmidt@google.com>2018-01-05 10:34:38 -0800
commited6c6f9fea3e1e429972cbd0e65f3fc7c05e41e2 (patch)
tree8247e9786c78841e987a8199960ec245e32a8833 /Firestore/Example/Tests/Integration
parent275b4e5a7633d69b6de36551398e88943dca8432 (diff)
Fixing potential race in ServerTimestamp tests
Diffstat (limited to 'Firestore/Example/Tests/Integration')
-rw-r--r--Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m12
1 files changed, 8 insertions, 4 deletions
diff --git a/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m b/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m
index 5cda053..cc0ab29 100644
--- a/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m
+++ b/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m
@@ -101,15 +101,19 @@
/** Waits for a snapshot with local writes. */
- (FIRDocumentSnapshot *)waitForLocalEvent {
- FIRDocumentSnapshot *snapshot = [_accumulator awaitEventWithName:@"Local event."];
- XCTAssertTrue(snapshot.metadata.hasPendingWrites);
+ FIRDocumentSnapshot *snapshot;
+ do {
+ snapshot = [_accumulator awaitEventWithName:@"Local event."];
+ } while (!snapshot.metadata.hasPendingWrites);
return snapshot;
}
/** Waits for a snapshot that has no pending writes */
- (FIRDocumentSnapshot *)waitForRemoteEvent {
- FIRDocumentSnapshot *snapshot = [_accumulator awaitEventWithName:@"Remote event."];
- XCTAssertFalse(snapshot.metadata.hasPendingWrites);
+ FIRDocumentSnapshot *snapshot;
+ do {
+ snapshot = [_accumulator awaitEventWithName:@"Remote event."];
+ } while (snapshot.metadata.hasPendingWrites);
return snapshot;
}