Skip to content

Commit

Permalink
fix(datastore): Fix test failure introduced with slower test runs fro…
Browse files Browse the repository at this point in the history
…m SQLite (#2708)
  • Loading branch information
tylerjroach authored Feb 7, 2024
1 parent 932c4f8 commit c8d9863
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ public void hydrationContinuesEvenIfOneItemFailsToSync() throws AmplifyException
);

actualSyncTimeRecords.blockingForEach(record ->
assertTrue(RecentTimeWindow.contains(record.getLastSyncTime()))
assertTrue("Time window of " + (Time.now() - record.getLastSyncTime()) +
" exceeded maximum", RecentTimeWindow.contains(record.getLastSyncTime()))
);

// Cleanup!
Expand Down Expand Up @@ -956,7 +957,7 @@ private void assertContentEquals(
}

static final class RecentTimeWindow {
private static final long ACCEPTABLE_DRIFT_MS = TimeUnit.SECONDS.toMillis(1);
private static final long ACCEPTABLE_DRIFT_MS = TimeUnit.SECONDS.toMillis(2);

private RecentTimeWindow() {}

Expand Down

0 comments on commit c8d9863

Please sign in to comment.