Skip to content

Commit 37268f7

Browse files
committed
Add timeout to avoid local ydb freezing
1 parent a0a7634 commit 37268f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
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)
@@ -95,7 +97,7 @@ private Status createResourcePool(String poolName) {
9597
String createPool = "CREATE RESOURCE POOL " + poolName + " WITH ("
9698
+ "CONCURRENT_QUERY_LIMIT=10,"
9799
+ "QUEUE_SIZE=1000,"
98-
+ "DATABASE_LOAD_CPU_THRESHOLD=80);";
100+
+ "DATABASE_LOAD_CPU_THRESHOLD=20);";
99101
return retryCtx.supplyResult(s -> s.createQuery(createPool, TxMode.NONE).execute()).join().getStatus();
100102
}
101103

0 commit comments

Comments
 (0)