This is an automated email from the ASF dual-hosted git repository.
korlov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 37b1eac6883 IGNITE-25393 Sql. Unmute
QueryTimeoutTest#testTimeoutDistributedRead (#6000)
37b1eac6883 is described below
commit 37b1eac688399370139e926795d3f16da0c8e13a
Author: korlov42 <[email protected]>
AuthorDate: Wed Jun 11 15:58:50 2025 +0300
IGNITE-25393 Sql. Unmute QueryTimeoutTest#testTimeoutDistributedRead (#6000)
---
.../sql/engine/exec/QueryRecoveryTest.java | 6 +++++
.../internal/sql/engine/exec/QueryTimeoutTest.java | 10 +++++---
.../sql/engine/framework/TestBuilders.java | 27 ++++++++++++++++++++++
3 files changed, 40 insertions(+), 3 deletions(-)
diff --git
a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/QueryRecoveryTest.java
b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/QueryRecoveryTest.java
index ee6f96ed581..9430e4846ff 100644
---
a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/QueryRecoveryTest.java
+++
b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/QueryRecoveryTest.java
@@ -59,6 +59,7 @@ import org.apache.ignite.lang.CancellationToken;
import org.apache.ignite.lang.ErrorGroups.Transactions;
import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -79,6 +80,11 @@ public class QueryRecoveryTest extends
BaseIgniteAbstractTest {
private TestCluster cluster;
+ @BeforeAll
+ static void warmUpCluster() throws Exception {
+ TestBuilders.warmupTestCluster();
+ }
+
@BeforeEach
void startCluster() {
cluster = TestBuilders.cluster()
diff --git
a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/QueryTimeoutTest.java
b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/QueryTimeoutTest.java
index 3e1135cc53d..8cf27f2b70c 100644
---
a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/QueryTimeoutTest.java
+++
b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/QueryTimeoutTest.java
@@ -49,8 +49,8 @@ import org.apache.ignite.internal.util.SubscriptionUtils;
import org.apache.ignite.sql.SqlException;
import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/** Tests cases for cancellation due to timeout. */
@@ -64,11 +64,16 @@ public class QueryTimeoutTest extends
BaseIgniteAbstractTest {
// query have to make it to the final point which is varied from test to
test in
// order to 1) make sure timeout is handled properly at particular stages
of query
// execution, and 2) to fail with proper exception class.
- private static final SqlProperties PROPS_WITH_TIMEOUT = new
SqlProperties().queryTimeout(2_000L);
+ private static final SqlProperties PROPS_WITH_TIMEOUT = new
SqlProperties().queryTimeout(1_000L);
private TestCluster cluster;
private TestNode gatewayNode;
+ @BeforeAll
+ static void warmUpCluster() throws Exception {
+ TestBuilders.warmupTestCluster();
+ }
+
@BeforeEach
void startCluster() {
ignoreCatalogUpdates.set(false);
@@ -173,7 +178,6 @@ public class QueryTimeoutTest extends
BaseIgniteAbstractTest {
}
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-25393 ")
void testTimeoutDistributedRead() {
AsyncSqlCursor<?> cursor =
gatewayNode.executeQuery(PROPS_WITH_TIMEOUT, "SELECT * FROM my_table");
diff --git
a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestBuilders.java
b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestBuilders.java
index 4cf2692f115..3f650b378e4 100644
---
a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestBuilders.java
+++
b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestBuilders.java
@@ -1977,4 +1977,31 @@ public class TestBuilders {
return nullCompletedFuture();
}
}
+
+ /**
+ * Creates a cluster and runs a simple query to facilitate loading of
necessary classes to prepare and execute sql queries.
+ *
+ * @throws Exception An exception if something goes wrong.
+ */
+ public static void warmupTestCluster() throws Exception {
+ TestCluster cluster = cluster()
+ .nodes("N1")
+ .defaultDataProvider(tableName ->
tableScan(DataProvider.fromCollection(List.of())))
+ .defaultAssignmentsProvider(tableName -> (partitionsCount,
includeBackups) -> IntStream.range(0, partitionsCount)
+ .mapToObj(i -> List.of("N1"))
+ .collect(Collectors.toList()))
+ .build();
+
+ cluster.start();
+
+ try {
+ TestNode node = cluster.node("N1");
+
+ node.initSchema("CREATE TABLE t (id INT PRIMARY KEY, val INT)");
+
+ await(node.executeQuery("SELECT * FROM t").requestNextAsync(1));
+ } finally {
+ cluster.stop();
+ }
+ }
}