Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillKurdyukov committed Nov 18, 2024
1 parent 4f3723a commit 1eed680
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public void integrationTest() throws ExecutionException, InterruptedException, S
Instant.now(), "semaphore", Duration.ofSeconds(100), Duration.ZERO));

optinal.ifPresent(simpleLock -> {
if (locked.compareAndSet(false, true)) {
logger.debug("Failed test! System has two leaders");
if (!locked.compareAndSet(false, true)) {
logger.error("Failed test! System has two leaders");

throw new RuntimeException();
}
Expand All @@ -100,10 +100,9 @@ public void integrationTest() throws ExecutionException, InterruptedException, S
}

atomicInt.addAndGet(50);
locked.set(false);
logger.info("Leader does UNLOCK!");

simpleLock.unlock();
locked.set(false);
});

try {
Expand Down

0 comments on commit 1eed680

Please sign in to comment.