From 1eed680e9bd8d6fa594411a9ea7e130d72a84b5b Mon Sep 17 00:00:00 2001 From: Kirill Kurdyukov Date: Mon, 18 Nov 2024 18:44:11 +0300 Subject: [PATCH] fix test --- .../java/tech/ydb/lock/provider/YdbLockProviderTest.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shedlock-ydb/src/test/java/tech/ydb/lock/provider/YdbLockProviderTest.java b/shedlock-ydb/src/test/java/tech/ydb/lock/provider/YdbLockProviderTest.java index 6e38753..99dca48 100644 --- a/shedlock-ydb/src/test/java/tech/ydb/lock/provider/YdbLockProviderTest.java +++ b/shedlock-ydb/src/test/java/tech/ydb/lock/provider/YdbLockProviderTest.java @@ -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(); } @@ -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 {