From 0141d644a0658b92d53b880521e636b21c003be6 Mon Sep 17 00:00:00 2001 From: Daniil Zulin Date: Fri, 28 Mar 2025 03:44:39 +0700 Subject: [PATCH 1/4] Replaced all synchronized blocks with Locks --- .../ydb/core/impl/call/ReadStreamCall.java | 25 ++++-- .../core/impl/call/ReadWriteStreamCall.java | 41 +++++++-- .../tech/ydb/core/impl/MockedScheduler.java | 30 ++++--- .../core/impl/pool/ManagedChannelMock.java | 19 +++- .../integration/docker/GrpcProxyServer.java | 42 ++++++--- .../test/junit5/GrpcTransportExtension.java | 86 ++++++++++++------- .../ydb/test/junit5/YdbHelperExtension.java | 66 +++++++++----- 7 files changed, 213 insertions(+), 96 deletions(-) diff --git a/core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java b/core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java index bdb908b5e..3962690f3 100644 --- a/core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java +++ b/core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java @@ -3,6 +3,8 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import javax.annotation.Nullable; @@ -29,6 +31,7 @@ public class ReadStreamCall extends ClientCall.Listener impl private final String traceId; private final ClientCall call; + private final Lock callLock = new ReentrantLock(); private final GrpcStatusHandler statusConsumer; private final ReqT request; private final Metadata headers; @@ -56,7 +59,8 @@ public CompletableFuture start(Observer observer) { throw new IllegalStateException("Read stream call is already started"); } - synchronized (call) { + callLock.lock(); + try { call.start(this, headers); if (logger.isTraceEnabled()) { @@ -74,16 +78,21 @@ public CompletableFuture start(Observer observer) { } statusFuture.completeExceptionally(t); + } finally { + callLock.unlock(); } - } + return statusFuture; } @Override public void cancel() { - synchronized (call) { + callLock.lock(); + try { call.cancel("Cancelled on user request", new CancellationException()); + } finally { + callLock.unlock(); } } @@ -95,15 +104,21 @@ public void onMessage(RespT message) { } observerReference.get().onNext(message); // request delivery of the next inbound message. - synchronized (call) { + callLock.lock(); + try { call.request(1); + } finally { + callLock.unlock(); } } catch (Exception ex) { statusFuture.completeExceptionally(ex); try { - synchronized (call) { + callLock.lock(); + try { call.cancel("Canceled by exception from observer", ex); + } finally { + callLock.unlock(); } } catch (Throwable th) { logger.error("ReadStreamCall[{}] got exception while canceling", traceId, th); diff --git a/core/src/main/java/tech/ydb/core/impl/call/ReadWriteStreamCall.java b/core/src/main/java/tech/ydb/core/impl/call/ReadWriteStreamCall.java index 761a3610d..13da70d81 100644 --- a/core/src/main/java/tech/ydb/core/impl/call/ReadWriteStreamCall.java +++ b/core/src/main/java/tech/ydb/core/impl/call/ReadWriteStreamCall.java @@ -5,6 +5,8 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import javax.annotation.Nullable; @@ -33,6 +35,7 @@ public class ReadWriteStreamCall extends ClientCall.Listener implements private final String traceId; private final ClientCall call; + private final Lock callLock = new ReentrantLock(); private final GrpcStatusHandler statusConsumer; private final Metadata headers; private final AuthCallOptions callOptions; @@ -66,7 +69,8 @@ public CompletableFuture start(Observer observer) { throw new IllegalStateException("Read stream call is already started"); } - synchronized (call) { + callLock.lock(); + try { call.start(this, headers); call.request(1); @@ -78,15 +82,18 @@ public CompletableFuture start(Observer observer) { } statusFuture.completeExceptionally(t); + } finally { + + callLock.unlock(); } - } return statusFuture; } @Override public void sendNext(W message) { - synchronized (call) { + callLock.lock(); + try { if (flush()) { if (logger.isTraceEnabled()) { String msg = TextFormat.shortDebugString((Message) message); @@ -96,6 +103,8 @@ public void sendNext(W message) { } else { messagesQueue.add(message); } + } finally { + callLock.unlock(); } } @@ -118,8 +127,11 @@ private boolean flush() { @Override public void cancel() { - synchronized (call) { + callLock.lock(); + try { call.cancel("Cancelled on user request", new CancellationException()); + } finally { + callLock.unlock(); } } @@ -132,15 +144,21 @@ public void onMessage(R message) { observerReference.get().onNext(message); // request delivery of the next inbound message. - synchronized (call) { + callLock.lock(); + try { call.request(1); + } finally { + callLock.unlock(); } } catch (Exception ex) { statusFuture.completeExceptionally(ex); try { - synchronized (call) { + callLock.lock(); + try { call.cancel("Canceled by exception from observer", ex); + } finally { + callLock.unlock(); } } catch (Throwable th) { logger.error("Exception encountered while canceling the read write stream call", th); @@ -150,15 +168,21 @@ public void onMessage(R message) { @Override public void onReady() { - synchronized (call) { + callLock.lock(); + try { flush(); + } finally { + callLock.unlock(); } } @Override public void close() { - synchronized (call) { + callLock.lock(); + try { call.halfClose(); + } finally { + callLock.unlock(); } } @@ -176,4 +200,3 @@ public void onClose(io.grpc.Status status, @Nullable Metadata trailers) { } } } - diff --git a/core/src/test/java/tech/ydb/core/impl/MockedScheduler.java b/core/src/test/java/tech/ydb/core/impl/MockedScheduler.java index 7adea2ebb..e03d54182 100644 --- a/core/src/test/java/tech/ydb/core/impl/MockedScheduler.java +++ b/core/src/test/java/tech/ydb/core/impl/MockedScheduler.java @@ -18,6 +18,8 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import org.junit.Assert; @@ -27,6 +29,7 @@ */ public class MockedScheduler implements ScheduledExecutorService { private final MockedClock clock; + private final Lock nextTaskLock = new ReentrantLock(); private final Queue> tasks = new ConcurrentLinkedQueue<>(); private volatile boolean queueIsBlocked = false; @@ -46,18 +49,23 @@ public MockedScheduler hasTasksCount(int count) { return this; } - public synchronized MockedScheduler runNextTask() { - queueIsBlocked = true; - MockedTask next = tasks.poll(); - Assert.assertNotNull("Scheduler's queue is empty", next); - clock.goToFuture(next.time); - next.run(); - if (next.time != null) { - tasks.add(next); - } + public MockedScheduler runNextTask() { + nextTaskLock.lock(); + try { + queueIsBlocked = true; + MockedTask next = tasks.poll(); + Assert.assertNotNull("Scheduler's queue is empty", next); + clock.goToFuture(next.time); + next.run(); + if (next.time != null) { + tasks.add(next); + } - queueIsBlocked = false; - return this; + queueIsBlocked = false; + return this; + } finally { + nextTaskLock.unlock(); + } } @Override diff --git a/core/src/test/java/tech/ydb/core/impl/pool/ManagedChannelMock.java b/core/src/test/java/tech/ydb/core/impl/pool/ManagedChannelMock.java index a3e581606..46b342ea0 100644 --- a/core/src/test/java/tech/ydb/core/impl/pool/ManagedChannelMock.java +++ b/core/src/test/java/tech/ydb/core/impl/pool/ManagedChannelMock.java @@ -6,6 +6,8 @@ import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import io.grpc.CallOptions; import io.grpc.ClientCall; @@ -26,7 +28,7 @@ public class ManagedChannelMock extends ManagedChannel { private final ExecutorService executor = Executors.newFixedThreadPool(1); private final BlockingQueue nextStates = new LinkedBlockingDeque<>(); - private final Object sync = new Object(); + private final Lock sync = new ReentrantLock(); private volatile ConnectivityState state; private Runnable listener = null; @@ -49,7 +51,8 @@ private void requestUpdate() { logger.trace("next mock state {}", next); - synchronized (sync) { + sync.lock(); + try { this.state = next; if (this.listener != null) { Runnable callback = this.listener; @@ -57,6 +60,8 @@ private void requestUpdate() { this.listener = null; callback.run(); } + } finally { + sync.unlock(); } }); } @@ -90,18 +95,22 @@ public String authority() { @Override public ConnectivityState getState(boolean requestConnection) { - synchronized (sync) { + sync.lock(); + try { logger.trace("get state {} with request {}", state, requestConnection); if (requestConnection) { requestUpdate(); } return state; + } finally { + sync.unlock(); } } @Override public void notifyWhenStateChanged(ConnectivityState source, Runnable callback) { - synchronized (sync) { + sync.lock(); + try { logger.trace("notify of changes for state {} with current {} and callback {}", source, state, callback.hashCode()); if (source != state) { @@ -109,6 +118,8 @@ public void notifyWhenStateChanged(ConnectivityState source, Runnable callback) } else { this.listener = callback; } + } finally { + sync.unlock(); } requestUpdate(); } diff --git a/tests/common/src/main/java/tech/ydb/test/integration/docker/GrpcProxyServer.java b/tests/common/src/main/java/tech/ydb/test/integration/docker/GrpcProxyServer.java index dd1a624b6..d37b7d2cb 100644 --- a/tests/common/src/main/java/tech/ydb/test/integration/docker/GrpcProxyServer.java +++ b/tests/common/src/main/java/tech/ydb/test/integration/docker/GrpcProxyServer.java @@ -4,6 +4,8 @@ import java.io.IOException; import java.io.InputStream; import java.net.InetAddress; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import com.google.common.io.ByteStreams; import io.grpc.CallOptions; @@ -69,6 +71,7 @@ private static class CallProxy { } private class RequestProxy extends ServerCall.Listener { + private final Lock clientCallLock = new ReentrantLock(); private final ClientCall clientCall; // Hold 'this' lock when accessing private boolean needToRequest; @@ -90,7 +93,8 @@ public void onHalfClose() { @Override public void onMessage(ReqT message) { clientCall.sendMessage(message); - synchronized (this) { + clientCallLock.lock(); + try { if (clientCall.isReady()) { clientCallListener.serverCall.request(1); } else { @@ -98,6 +102,8 @@ public void onMessage(ReqT message) { // wait for it to catch up. needToRequest = true; } + } finally { + clientCallLock.unlock(); } } @@ -108,15 +114,21 @@ public void onReady() { // Called from ResponseProxy, which is a different thread than the ServerCall.Listener // callbacks. - synchronized void onClientReady() { - if (needToRequest) { - clientCallListener.serverCall.request(1); - needToRequest = false; + void onClientReady() { + clientCallLock.lock(); + try { + if (needToRequest) { + clientCallListener.serverCall.request(1); + needToRequest = false; + } + } finally { + clientCallLock.unlock(); } } } private class ResponseProxy extends ClientCall.Listener { + private final Lock serverCallLock = new ReentrantLock(); private final ServerCall serverCall; // Hold 'this' lock when accessing private boolean needToRequest; @@ -138,7 +150,8 @@ public void onHeaders(Metadata headers) { @Override public void onMessage(RespT message) { serverCall.sendMessage(message); - synchronized (this) { + serverCallLock.lock(); + try { if (serverCall.isReady()) { serverCallListener.clientCall.request(1); } else { @@ -146,6 +159,8 @@ public void onMessage(RespT message) { // and wait for it to catch up. needToRequest = true; } + } finally { + serverCallLock.unlock(); } } @@ -156,10 +171,15 @@ public void onReady() { // Called from RequestProxy, which is a different thread than the ClientCall.Listener // callbacks. - synchronized void onServerReady() { - if (needToRequest) { - serverCallListener.clientCall.request(1); - needToRequest = false; + void onServerReady() { + serverCallLock.lock(); + try { + if (needToRequest) { + serverCallListener.clientCall.request(1); + needToRequest = false; + } + } finally { + serverCallLock.unlock(); } } } @@ -210,5 +230,5 @@ public byte[] parse(InputStream stream) { public InputStream stream(byte[] value) { return new ByteArrayInputStream(value); } - }; + } } diff --git a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java index d4ba5f990..a0884bfb0 100644 --- a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java +++ b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java @@ -15,6 +15,9 @@ import tech.ydb.test.integration.YdbHelperFactory; import tech.ydb.test.integration.utils.ProxyGrpcTransport; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + /** * * @author Aleksandr Gorshenin @@ -63,53 +66,70 @@ public void afterEach(ExtensionContext ec) throws Exception { } private class Holder { + private final Lock holderLock = new ReentrantLock(); + private YdbHelper helper = null; private GrpcTransport transport = null; private ExtensionContext context = null; - public synchronized void before(ExtensionContext ec) { - if (helper != null) { - return; - } - - YdbHelperFactory factory = YdbHelperFactory.getInstance(); - helper = factory.createHelper(); - if (helper != null) { - context = ec; - - String path = ""; - if (ec.getTestClass().isPresent()) { - path += "/" + ec.getTestClass().get().getName(); + public void before(ExtensionContext ec) { + holderLock.lock(); + try { + if (helper != null) { + return; } - if (ec.getTestMethod().isPresent()) { - path += "/" + ec.getTestMethod().get().getName(); + YdbHelperFactory factory = YdbHelperFactory.getInstance(); + helper = factory.createHelper(); + if (helper != null) { + context = ec; + + String path = ""; + if (ec.getTestClass().isPresent()) { + path += "/" + ec.getTestClass().get().getName(); + } + if (ec.getTestMethod().isPresent()) { + path += "/" + ec.getTestMethod().get().getName(); + } + + logger.debug("create ydb helper for path {}", path); + transport = helper.createTransport(); } - - logger.debug("create ydb helper for path {}", path); - transport = helper.createTransport(); + } finally { + holderLock.unlock(); } } - public synchronized void after(ExtensionContext ec) { - if (context != ec) { - return; - } + public void after(ExtensionContext ec) { + holderLock.lock(); - if (transport != null) { - transport.close(); - transport = null; - } + try { + if (context != ec) { + return; + } - if (helper != null) { - helper.close(); - helper = null; - } + if (transport != null) { + transport.close(); + transport = null; + } - context = null; + if (helper != null) { + helper.close(); + helper = null; + } + + context = null; + } finally { + holderLock.unlock(); + } } - public synchronized GrpcTransport transport() { - return transport; + public GrpcTransport transport() { + holderLock.lock(); + try { + return transport; + } finally { + holderLock.unlock(); + } } } } diff --git a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java index ea98f0ea2..bdccbf163 100644 --- a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java +++ b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java @@ -14,6 +14,9 @@ import tech.ydb.test.integration.YdbHelperFactory; import tech.ydb.test.integration.utils.ProxyYdbHelper; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + /** * @author Aleksandr Gorshenin */ @@ -61,38 +64,55 @@ public void afterEach(ExtensionContext ec) throws Exception { } private class Holder { + private final Lock holderLock = new ReentrantLock(); + private YdbHelper helper = null; private ExtensionContext context = null; - public synchronized void before(ExtensionContext ec) { - if (helper != null) { - return; - } - - YdbHelperFactory factory = YdbHelperFactory.getInstance(); - logger.debug("create ydb helper for test {}", ec.getDisplayName()); - helper = factory.createHelper(); - - if (helper != null) { - context = ec; + public void before(ExtensionContext ec) { + holderLock.lock(); + try { + if (helper != null) { + return; + } + + YdbHelperFactory factory = YdbHelperFactory.getInstance(); + logger.debug("create ydb helper for test {}", ec.getDisplayName()); + helper = factory.createHelper(); + + if (helper != null) { + context = ec; + } + } finally { + holderLock.unlock(); } } - public synchronized void after(ExtensionContext ec) { - if (context != ec) { - return; + public void after(ExtensionContext ec) { + holderLock.lock(); + try { + if (context != ec) { + return; + } + + if (helper != null) { + helper.close(); + helper = null; + } + + context = null; + } finally { + holderLock.unlock(); } - - if (helper != null) { - helper.close(); - helper = null; - } - - context = null; } - public synchronized YdbHelper helper() { - return helper; + public YdbHelper helper() { + holderLock.lock(); + try { + return helper; + } finally { + holderLock.unlock(); + } } } } From cfc000c28eaa2f3ebd155a90f94aa7e2a964c2c8 Mon Sep 17 00:00:00 2001 From: Daniil Zulin Date: Fri, 28 Mar 2025 03:45:25 +0700 Subject: [PATCH 2/4] Replaced all synchronized blocks with Locks --- .../main/java/tech/ydb/test/junit5/GrpcTransportExtension.java | 2 +- .../src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java index a0884bfb0..921112fcf 100644 --- a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java +++ b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java @@ -65,7 +65,7 @@ public void afterEach(ExtensionContext ec) throws Exception { holder.after(ec); } - private class Holder { + private static class Holder { private final Lock holderLock = new ReentrantLock(); private YdbHelper helper = null; diff --git a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java index bdccbf163..e55681824 100644 --- a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java +++ b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java @@ -63,7 +63,7 @@ public void afterEach(ExtensionContext ec) throws Exception { holder.after(ec); } - private class Holder { + private static class Holder { private final Lock holderLock = new ReentrantLock(); private YdbHelper helper = null; From 6ce9a703a9b70ca2d766de4d319eadd7183f3bfe Mon Sep 17 00:00:00 2001 From: Daniil Zulin Date: Fri, 28 Mar 2025 03:56:05 +0700 Subject: [PATCH 3/4] Formatting fix --- .../ydb/core/impl/call/ReadStreamCall.java | 36 +++++++++---------- .../core/impl/call/ReadWriteStreamCall.java | 26 +++++++------- 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java b/core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java index 3962690f3..ce8997441 100644 --- a/core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java +++ b/core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java @@ -60,28 +60,26 @@ public CompletableFuture start(Observer observer) { } callLock.lock(); - + try { + call.start(this, headers); + if (logger.isTraceEnabled()) { + logger.trace("ReadStreamCall[{}] --> {}", traceId, TextFormat.shortDebugString((Message) request)); + } + call.sendMessage(request); + // close stream by client side + call.halfClose(); + call.request(1); + } catch (Throwable t) { try { - call.start(this, headers); - if (logger.isTraceEnabled()) { - logger.trace("ReadStreamCall[{}] --> {}", traceId, TextFormat.shortDebugString((Message) request)); - } - call.sendMessage(request); - // close stream by client side - call.halfClose(); - call.request(1); - } catch (Throwable t) { - try { - call.cancel(null, t); - } catch (Throwable ex) { - logger.error("ReadStreamCall[{}] got exception while canceling", traceId, ex); - } - - statusFuture.completeExceptionally(t); - } finally { - callLock.unlock(); + call.cancel(null, t); + } catch (Throwable ex) { + logger.error("ReadStreamCall[{}] got exception while canceling", traceId, ex); } + statusFuture.completeExceptionally(t); + } finally { + callLock.unlock(); + } return statusFuture; } diff --git a/core/src/main/java/tech/ydb/core/impl/call/ReadWriteStreamCall.java b/core/src/main/java/tech/ydb/core/impl/call/ReadWriteStreamCall.java index 13da70d81..d1b2dd589 100644 --- a/core/src/main/java/tech/ydb/core/impl/call/ReadWriteStreamCall.java +++ b/core/src/main/java/tech/ydb/core/impl/call/ReadWriteStreamCall.java @@ -70,23 +70,21 @@ public CompletableFuture start(Observer observer) { } callLock.lock(); - + try { + call.start(this, headers); + call.request(1); + } catch (Throwable t) { try { - call.start(this, headers); - call.request(1); - } catch (Throwable t) { - try { - call.cancel(null, t); - } catch (Throwable ex) { - logger.error("Exception encountered while closing the unary call", ex); - } - - statusFuture.completeExceptionally(t); - } finally { - - callLock.unlock(); + call.cancel(null, t); + } catch (Throwable ex) { + logger.error("Exception encountered while closing the unary call", ex); } + statusFuture.completeExceptionally(t); + } finally { + callLock.unlock(); + } + return statusFuture; } From 19ce14acd91ff6fce7294056a4086018ea6cd60f Mon Sep 17 00:00:00 2001 From: Daniil Zulin Date: Fri, 28 Mar 2025 04:15:27 +0700 Subject: [PATCH 4/4] Fix checkstyle --- .../java/tech/ydb/test/junit5/GrpcTransportExtension.java | 6 +++--- .../main/java/tech/ydb/test/junit5/YdbHelperExtension.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java index 921112fcf..db7af25ea 100644 --- a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java +++ b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/GrpcTransportExtension.java @@ -1,5 +1,8 @@ package tech.ydb.test.junit5; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + import org.junit.jupiter.api.extension.AfterAllCallback; import org.junit.jupiter.api.extension.AfterEachCallback; import org.junit.jupiter.api.extension.BeforeAllCallback; @@ -15,9 +18,6 @@ import tech.ydb.test.integration.YdbHelperFactory; import tech.ydb.test.integration.utils.ProxyGrpcTransport; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - /** * * @author Aleksandr Gorshenin diff --git a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java index e55681824..f69dd55e0 100644 --- a/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java +++ b/tests/junit5-support/src/main/java/tech/ydb/test/junit5/YdbHelperExtension.java @@ -1,5 +1,8 @@ package tech.ydb.test.junit5; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + import org.junit.jupiter.api.extension.AfterAllCallback; import org.junit.jupiter.api.extension.AfterEachCallback; import org.junit.jupiter.api.extension.BeforeAllCallback; @@ -14,9 +17,6 @@ import tech.ydb.test.integration.YdbHelperFactory; import tech.ydb.test.integration.utils.ProxyYdbHelper; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - /** * @author Aleksandr Gorshenin */