These instructions apply to integration-test/ and supplement the repository-level instructions.
IT*, *IT, or *ITCase. Prefer the existing IoTDB...IT convention; put variant numbers before the suffix, such as IoTDBActiveRegionScan2IT, not IoTDBActiveRegionScanIT2. An IoTDB prefix or a Test suffix alone does not make a class discoverable.@Category, declared on the method, its class, or a superclass. All test profiles filter by category; @Test and @RunWith alone are not sufficient. In a class using method-level categories without a class/superclass category, annotate every new @Test method, even when neighboring methods already have categories.pom.xml. Shared packages such as session/it contain both tree and table tests; the package name alone does not determine the category. Check the corresponding CI workflow for specialized categories such as DailyIT and multi-cluster tests.@RunWith(IoTDBTestRunner.class); retain inherited or specialized runners for parameterized fixtures such as AbstractSchemaIT instead of replacing them.EnvFactory.getEnv() connection helpers or client builders with their default credentials when a test does not need a specific user.SessionConfig.DEFAULT_USER and SessionConfig.DEFAULT_PASSWORD. This includes NodesSupplier, pools, and direct RPC helpers; do not hardcode "root" as the default password. Default credentials can differ between IoTDB and downstream editions._ - ! @ # $ % ^ & * ( ) + =), containing at least one lowercase letter, one uppercase letter, one digit, and one special character, and different from the username; usernames use the same charset and a 4-32 character length (for example newuser with IoTDB!Test2024). Trivial placeholders such as 123456 or password pass on a default local cluster yet are exactly what stricter password policies reject, and they encourage weak secrets to spread into real configurations through copied test code. Reserve weak or illegal credentials for scenarios that deliberately test them.EnvUtils.getNodeStatusAfterLocalStop() where applicable; graceful process termination behaves differently on Unix and Windows. Use the appropriate status expectation for forced termination.COUNT DATABASE or COUNT DATABASE root.** in ITs, including helper methods and wait conditions. Limit counts to an explicit test-owned database path or test-specific path pattern, or assert the existence or absence of the specific test databases. Do not assume that the cluster's total database count equals the number created by the test; pre-existing databases can vary across test environments.finally as appropriate.@Ignore merely to make a failing test pass CI. If a known product defect must be quarantined, retain the reproducer and document the defect, affected topology, and tracking reference; report skipped cases separately.TSStatusCode, compare the low 8 bits of both values (& 0xFF); keep full status-code checks for RPC responses.TestUtils.treeResultSetEqualTestUnordered(sql, expectedHeader, expectedRetArray) for tree-model SQL cases, or TestUtils.tableResultSetEqualTestUnordered(sql, expectedHeader, expectedRetArray, database) for table-model SQL cases (database may be null when no USE is needed). When the test already owns a result set, use TestUtils.assertResultSetEqualUnordered(resultSet, expectedHeader, expectedRows) and close the original result set after the assertion. Reuse these helpers instead of writing per-node comparison loops in individual tests.ClusterTestResultSet.getNodeResultSets to read each DataNode's underlying result set. The default ClusterTestResultSet compares nodes at the same cursor position; collecting or sorting rows after reading through that wrapper cannot avoid row-order mismatches. Do not replace the helpers with set equality or single-node checks that weaken these assertions.LIMIT/OFFSET, ensure the selected rows are deterministic before applying unordered equality; sorting cannot repair a nondeterministic subset. Add sufficient ORDER BY tie-breakers when needed.This module is excluded from the default build. Run the commands below from the repository root, always enabling -P with-integration-tests when building or testing this module.
Format Java changes with mvn spotless:apply -pl integration-test -P with-integration-tests.
After adding or renaming tests, changing categories or inheritance, or editing CI test selection, run this source-level check from the repository root before the Maven build:
python3 .github/scripts/check-it-selection.py
groups/excludedGroups, POM excludes, and @Ignore; the check does not prove that a particular CI job selects a test. Running a test in an IDE or explicitly with -Dit.test does not prove default CI discovery..github/scripts/build-it-shard-list.sh: shard all candidate classes by fully qualified name and let Failsafe apply category filters. Do not grep source files for category names; that misses inherited categories. Preserve POM excludes by using failsafe.includesFile, and reject empty lists because Failsafe falls back to default includes. Verify that shards cover each candidate exactly once and that their selected-test union matches the unsharded run for the same profile.Run only the affected IT classes or methods for a focused change. Select the matching test profile:
| Data model | Default topology | JUnit category | Test profile |
|---|---|---|---|
| Tree | 1 ConfigNode + 1 DataNode | LocalStandaloneIT | SimpleIT (default) |
| Tree | 1 ConfigNode + 3 DataNodes | ClusterIT | ClusterIT |
| Table | 1 ConfigNode + 1 DataNode | TableLocalStandaloneIT | TableSimpleIT |
| Table | 1 ConfigNode + 3 DataNodes | TableClusterIT | TableClusterIT |
For example, run one tree-model cluster test method:
mvn clean verify -DskipUTs \ '-Dit.test=ClassName#methodName' \ -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false \ -pl integration-test -am -PClusterIT -P with-integration-tests
Use -Dit.test=ClassName to run a whole class. Replace -PClusterIT with the profile needed by the test; it may be omitted for the default SimpleIT profile.
integration-test/target/failsafe-reports to confirm that the intended classes and methods actually ran, including expected parameterized variants, and inspect skipped counts. A successful Maven exit is insufficient: the no-tests flags allow upstream reactor modules to have no matching tests and can also hide an incorrectly selected IT.-DintegrationTest.configNodeStartupTrace=true to a targeted IT command to record JVM startup and class initialization before ConfigNode's first application log. The default is disabled to avoid tracing overhead. Each ConfigNode writes <node-log>.startup-<pid>.log alongside its normal log. JVM startup events include nested phases; class initialization events mark their start and do not measure exclusive class execution time.Build the node templates before an IDE run or a direct Failsafe invocation, and rebuild them after code changes:
mvn clean package -DskipTests -pl integration-test -am -P with-integration-tests
The clean verify command above already includes this packaging step. In IntelliJ, enable the with-integration-tests profile in the Maven sidebar before running test cases directly.
Build the Edge distribution before running its dedicated Tree/Table read-write IT:
mvn clean package -DskipTests -pl distribution -am mvn verify -DskipUTs -Dit.test=IoTDBEdgeBasicIT \ -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false \ -pl integration-test -am -P EdgeIT -P with-integration-tests