This is an automated email from the ASF dual-hosted git repository.
Caideyipi pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/dev/1.3 by this push:
new 9ea36734bae [To dev/1.3] [Test] Speed up integration tests (#18954)
9ea36734bae is described below
commit 9ea36734baec8f62af853ee23fee720816e266ba
Author: Caideyipi <[email protected]>
AuthorDate: Fri Nov 6 10:26:00 2026 +0800
[To dev/1.3] [Test] Speed up integration tests (#18954)
---
.../org/apache/iotdb/db/it/utils/TestUtils.java | 8 +++----
.../pipe/it/autocreate/IoTDBPipeClusterIT.java | 5 ++---
.../session/it/IoTDBSessionSchemaTemplateIT.java | 26 +++++++++++++++++-----
.../it/IoTDBSubscriptionITConstant.java | 3 ++-
4 files changed, 28 insertions(+), 14 deletions(-)
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java
index 7ce8f63c9a1..d375cc20e78 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java
@@ -842,7 +842,7 @@ public class TestUtils {
// Keep retrying if there are execution failures
await()
.pollInSameThread()
- .pollDelay(1L, TimeUnit.SECONDS)
+ .pollDelay(0L, TimeUnit.SECONDS)
.pollInterval(1L, TimeUnit.SECONDS)
.atMost(timeoutSeconds, TimeUnit.SECONDS)
.untilAsserted(
@@ -872,7 +872,7 @@ public class TestUtils {
// Keep retrying if there are execution failures
await()
.pollInSameThread()
- .pollDelay(1L, TimeUnit.SECONDS)
+ .pollDelay(0L, TimeUnit.SECONDS)
.pollInterval(1L, TimeUnit.SECONDS)
.atMost(timeoutSeconds, TimeUnit.SECONDS)
.untilAsserted(
@@ -921,7 +921,7 @@ public class TestUtils {
// Keep retrying if there are execution failures
await()
.pollInSameThread()
- .pollDelay(1L, TimeUnit.SECONDS)
+ .pollDelay(0L, TimeUnit.SECONDS)
.pollInterval(1L, TimeUnit.SECONDS)
.atMost(timeoutSeconds, TimeUnit.SECONDS)
.untilAsserted(
@@ -952,7 +952,7 @@ public class TestUtils {
// Keep retrying if there are execution failures
await()
.pollInSameThread()
- .pollDelay(1L, TimeUnit.SECONDS)
+ .pollDelay(0L, TimeUnit.SECONDS)
.pollInterval(1L, TimeUnit.SECONDS)
.atMost(timeoutSeconds, TimeUnit.SECONDS)
.untilAsserted(
diff --git
a/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeClusterIT.java
b/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeClusterIT.java
index 43568e887d9..047ba3c5afb 100644
---
a/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeClusterIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeClusterIT.java
@@ -164,9 +164,8 @@ public class IoTDBPipeClusterIT extends
AbstractPipeDualAutoIT {
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(),
status.getCode());
receiverEnv.getDataNodeWrapper(0).stop();
-
- // Ensure that the kill -9 operation is completed
- Thread.sleep(5000);
+ // stop() waits for process exit; verify it succeeded before checking
failover.
+ Assert.assertFalse(receiverEnv.getDataNodeWrapper(0).isAlive());
for (DataNodeWrapper nodeWrapper : receiverEnv.getDataNodeWrapperList())
{
if (!nodeWrapper.isAlive()) {
continue;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSchemaTemplateIT.java
b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSchemaTemplateIT.java
index 96836c7d443..457c7114044 100644
---
a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSchemaTemplateIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSchemaTemplateIT.java
@@ -41,6 +41,7 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.junit.runners.Parameterized;
import java.io.IOException;
import java.util.ArrayList;
@@ -63,20 +64,33 @@ public class IoTDBSessionSchemaTemplateIT extends
AbstractSchemaIT {
super(schemaTestMode);
}
+ // Keep one cluster per schema engine mode, and clear its schema between
test methods.
+ @Parameterized.BeforeParam
+ public static void before() throws Exception {
+ setUpEnvironment();
+ EnvFactory.getEnv().initClusterEnvironment();
+ }
+
+ @Parameterized.AfterParam
+ public static void after() throws Exception {
+ EnvFactory.getEnv().cleanClusterEnvironment();
+ tearDownEnvironment();
+ }
+
@Before
public void setUp() throws Exception {
- setUpEnvironmentBeforeMethod();
- EnvFactory.getEnv().initClusterEnvironment();
session = EnvFactory.getEnv().getSessionConnection();
}
@After
public void tearDown() throws Exception {
- if (session != null) {
- session.close();
+ try {
+ if (session != null) {
+ session.close();
+ }
+ } finally {
+ clearSchema();
}
- EnvFactory.getEnv().cleanClusterEnvironment();
- tearDownEnvironment();
}
@Test
diff --git
a/integration-test/src/test/java/org/apache/iotdb/subscription/it/IoTDBSubscriptionITConstant.java
b/integration-test/src/test/java/org/apache/iotdb/subscription/it/IoTDBSubscriptionITConstant.java
index 3162139fb66..6c7eb061789 100644
---
a/integration-test/src/test/java/org/apache/iotdb/subscription/it/IoTDBSubscriptionITConstant.java
+++
b/integration-test/src/test/java/org/apache/iotdb/subscription/it/IoTDBSubscriptionITConstant.java
@@ -31,7 +31,8 @@ import java.util.function.Consumer;
public class IoTDBSubscriptionITConstant {
- private static final long AWAITILITY_POLL_DELAY_SECOND = 1L;
+ // Conditions may already hold when the assertion starts; only wait between
retries.
+ private static final long AWAITILITY_POLL_DELAY_SECOND = 0L;
private static final long AWAITILITY_POLL_INTERVAL_SECOND = 1L;
private static final long AWAITILITY_AT_MOST_SECOND = 600L;