Skip to content

Commit

Permalink
feat(core): Avoid time going backwards for CacheClock
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Aug 15, 2024
1 parent 3111963 commit 297036a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ void secondTimeIfBackwards() {
Clock cacheClock = new Clock.CacheClock(backwardsClock);
long lastTime = cacheClock.secondTime();
for (int i = 0; i < 6; i++) {
LockSupport.parkNanos(this, ONE_SECOND_PERIOD);
long currentTime = cacheClock.secondTime();
assertTrue(currentTime >= lastTime);
lastTime = currentTime;
LockSupport.parkNanos(this, ONE_SECOND_PERIOD);
}
}

Expand Down

0 comments on commit 297036a

Please sign in to comment.