Skip to content

Commit 4f3723a

Browse files
fix test
1 parent f6a07c9 commit 4f3723a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

shedlock-ydb/src/test/java/tech/ydb/lock/provider/YdbLockProviderTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void integrationTest() throws ExecutionException, InterruptedException, S
8787
Instant.now(), "semaphore", Duration.ofSeconds(100), Duration.ZERO));
8888

8989
optinal.ifPresent(simpleLock -> {
90-
if (locked.compareAndExchange(false, true)) {
90+
if (locked.compareAndSet(false, true)) {
9191
logger.debug("Failed test! System has two leaders");
9292

9393
throw new RuntimeException();
@@ -100,11 +100,10 @@ public void integrationTest() throws ExecutionException, InterruptedException, S
100100
}
101101

102102
atomicInt.addAndGet(50);
103-
locked.set(false);
104-
105103
logger.info("Leader does UNLOCK!");
106104

107105
simpleLock.unlock();
106+
locked.set(false);
108107
});
109108

110109
try {

0 commit comments

Comments
 (0)