Skip to content

Commit

Permalink
Make test less flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Aug 24, 2023
1 parent e4d2666 commit 38330d8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public void shouldNotBeAbleToExtendUnlockedLock() {
@Test
public void shouldNotBeAbleToExtendExpiredLock() {
Optional<SimpleLock> lock = getLockProvider().lock(lockConfig(LOCK_NAME1, Duration.ofMillis(1), Duration.ZERO));
sleepFor(Duration.ofMillis(1));
assertThat(lock).isNotEmpty();
sleepFor(Duration.ofMillis(2));

Optional<SimpleLock> newLock = lock.get().extend(Duration.ofSeconds(10), Duration.ZERO);
assertThat(newLock).isEmpty();
Expand Down

0 comments on commit 38330d8

Please sign in to comment.