Skip to content

Commit 8c0e7b0

Browse files
committed
Add timeout to avoid local ydb freezing
1 parent d99601c commit 8c0e7b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

query/src/test/java/tech/ydb/query/impl/ResourcePoolTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package tech.ydb.query.impl;
22

3+
import java.time.Duration;
34
import java.util.concurrent.CompletableFuture;
45

56
import org.junit.AfterClass;
@@ -79,6 +80,7 @@ public static void dropAll() {
7980

8081
private Status selectWithPool(String poolName) {
8182
ExecuteQuerySettings settings = ExecuteQuerySettings.newBuilder()
83+
.withRequestTimeout(Duration.ofSeconds(5))
8284
.withExecMode(QueryExecMode.EXECUTE)
8385
.withResourcePool(poolName)
8486
.withStatsMode(QueryStatsMode.FULL)
@@ -156,9 +158,11 @@ public void useDifferentPoolsTest() {
156158
Assert.assertTrue("Cannot create resource pool " + create4, create4.isSuccess());
157159

158160
ExecuteQuerySettings pool3 = ExecuteQuerySettings.newBuilder()
161+
.withRequestTimeout(Duration.ofSeconds(5))
159162
.withResourcePool("test_pool3")
160163
.build();
161164
ExecuteQuerySettings pool4 = ExecuteQuerySettings.newBuilder()
165+
.withRequestTimeout(Duration.ofSeconds(5))
162166
.withResourcePool("test_pool4")
163167
.build();
164168

0 commit comments

Comments
 (0)