diff --git a/.github/workflows/firestore-nightly.yml b/.github/workflows/firestore-nightly.yml index 753c3e732f7..e4261462f2f 100644 --- a/.github/workflows/firestore-nightly.yml +++ b/.github/workflows/firestore-nightly.yml @@ -15,7 +15,11 @@ name: firestore_nightly on: + pull_request: workflow_dispatch: + schedule: + # Run every day at 2am (PST) - cron uses UTC times + - cron: '0 10 * * *' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} diff --git a/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.mm b/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.mm index e23fe089752..1f8f28473fc 100644 --- a/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.mm +++ b/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.mm @@ -123,8 +123,13 @@ - (void)verifyTimestampsInSnapshot:(FIRDocumentSnapshot *)snapshot /** Verifies a snapshot containing _setData but with resolved server timestamps. */ - (void)verifySnapshotWithResolvedTimestamps:(FIRDocumentSnapshot *)snapshot { - // Tolerate up to 200 seconds of clock skew between client and server. - NSInteger tolerance = 200; + // Tolerate up to 10 seconds of clock skew between client and server. + NSInteger tolerance = 10; + + // Somehow the skew is much worse in nightly + if ([self.db.settings.host isEqualToString:@"test-firestore.sandbox.googleapis.com"]) { + tolerance = 200; + } XCTAssertTrue(snapshot.exists); FIRTimestamp *when = snapshot[@"when"];