iotdb / integration-test
AGENTS.md6.4k starsChanged 4 years agoApache-2.0View on GitHub
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License…
We split this AGENTS.md into the rules it gives an agent
27 rules. About 1 is common, 12 are distinctive, and 14 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Prefer the existing IoTDB...IT convention.
- Very specific: line 32
Every test method must have an effective JUnit @Category, declared on the method, its class, or a superclass.
- Distinctive: line 36
Prefer a class-level category when all cases share the same requirements.
- Very specific: line 43
Follow the neighboring tests' runner and environment lifecycle conventions.
- Very specific: line 49
Use EnvFactory.getEnv() connection helpers or client builders with their default credentials when a test does not need a specific user.
- Very specific: line 51
When constructing clients or helpers that require explicit default credentials, use SessionConfig.DEFAULT_USER and …
- Very specific: line 54
Default credentials can differ between IoTDB and downstream editions.
- Common: line 55
Keep a client's business connections and discovery/recovery helpers on the same credentials.
- Distinctive: line 56
Check helper methods as well as the main test body: a builder may use the correct defaults while a manually constructed discovery client …
- Very specific: line 60
When a test creates users or roles with explicit credentials, make each password 12-32 characters long with no spaces, drawn from the …
- Distinctive: line 75
Use bounded condition waits, such as Awaitility or environment status helpers, for startup, discovery, leader election, and recovery.
- Distinctive: line 77
When no read-only condition exposes the state being awaited, use a finite wait derived from the running server's effective configuration …
- Distinctive: line 81
Wait for each relevant layer separately.
- Distinctive: line 86
Keep connection/socket timeouts distinct from query timeouts and the overall assertion deadline.
- Distinctive: line 94
Do not label a failure as environmental or intermittent based only on one failed run.
- Distinctive: line 103
Keep tests that share a cluster independent of execution order: isolate their data and restore changed state or configuration using the …
- Distinctive: line 111
When enabling an old test or changing its expected result, verify the current intended client/server contract and preserve the original …
- Very specific: line 115
Do not weaken assertions, remove cluster categories, or add @Ignore merely to make a failing test pass CI.
- Very specific: line 124
When row order is not part of the query's contract and may differ across DataNodes, use TestUtils.treeResultSetEqualTestUnordered(sql, …
- Very specific: line 129
When the test already owns a result set, use TestUtils.assertResultSetEqualUnordered(resultSet, expectedHeader, expectedRows) and close the …
- Very specific: line 138
Keep ordered assertions when SQL guarantees the final result order.
- Distinctive: line 151
After adding or renaming tests, changing categories or inheritance, or editing CI test selection, run this source-level check from the …
- Very specific: line 162
When editing CI sharding, reuse .github/scripts/build-it-shard-list.sh: shard all candidate classes by fully qualified name and let …
- Distinctive: line 166
Verify that shards cover each candidate exactly once and that their selected-test union matches the unsharded run for the same profile.
- Distinctive: line 171
Run only the affected IT classes or methods for a focused change.
- Very specific: line 189
Use -Dit.test=ClassName to run a whole class.
- Very specific: line 192
Check integration-test/target/failsafe-reports to confirm that the intended classes and methods actually ran, including expected …
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->Integration Test Guidelines
These instructions apply to integration-test/ and supplement the repository-level instructions.
Test discovery and categories
- Name concrete IT classes to match Failsafe's default includes:
IT*,*IT, or*ITCase. Prefer the existingIoTDB...ITconvention; put variant numbers before the suffix, such asIoTDBActiveRegionScan2IT, notIoTDBActiveRegionScanIT2. AnIoTDBprefix or aTestsuffix alone does not make a class discoverable. - Every test method must have an effective JUnit
@Category, declared on the method, its class, or a superclass. All test profiles filter by category;@Testand@RunWithalone are not sufficient. In a class using method-level categories without a class/superclass category, annotate every new@Testmethod, even when neighboring methods already have categories. - Prefer a class-level category when all cases share the same requirements. Preserve method-level categories when cases need different profiles; adding a broad class category can enable cases in unintended environments. Inherited categories are valid and need not be copied to subclasses.
- Select categories by the actual data model and topology, using the profile mapping below and
pom.xml. Shared packages such assession/itcontain both tree and table tests; the package name alone does not determine the category. Check the corresponding CI workflow for specialized categories such asDailyITand multi-cluster tests. - Follow the neighboring tests' runner and environment lifecycle conventions. Ordinary ITs use
@RunWith(IoTDBTestRunner.class); retain inherited or specialized runners for parameterized fixtures such asAbstractSchemaITinstead of replacing them.
Credentials and deployment defaults
- Use
EnvFactory.getEnv()connection helpers or client builders with their default credentials when a test does not need a specific user. - When constructing clients or helpers that require explicit default credentials, use
SessionConfig.DEFAULT_USERandSessionConfig.DEFAULT_PASSWORD. This includesNodesSupplier, pools, and direct RPC helpers; do not hardcode"root"as the default password. Default credentials can differ between IoTDB and downstream editions. - Keep a client's business connections and discovery/recovery helpers on the same credentials. Check helper methods as well as the main test body: a builder may use the correct defaults while a manually constructed discovery client silently uses different ones.
- Explicit credentials are appropriate for users created by the test and for authentication or invalid-password scenarios. Make that intent clear, and clean up users created by the test.
- When a test creates users or roles with explicit credentials, make each password 12-32
characters long with no spaces, drawn from the supported credential charset (letters,
digits,
_ - ! @ # $ % ^ & * ( ) + =), 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 examplenewuserwithIoTDB!Test2024). Trivial placeholders such as123456orpasswordpass 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. - Obtain node addresses and allocated ports from the test environment or node wrappers. Configure required consensus protocols, replication factors, and other non-default settings before initializing the cluster.
Asynchronous behavior and failure recovery
- Use bounded condition waits, such as Awaitility or environment status helpers, for startup, discovery, leader election, and recovery. Prefer observable conditions over fixed sleeps.
- When no read-only condition exposes the state being awaited, use a finite wait derived from the running server's effective configuration and the required propagation rounds, with a documented safety margin. Reuse a feature-specific wait helper; do not guess a fixed duration or assume the test JVM's configuration singleton reflects a separately launched node's configuration.
- Wait for each relevant layer separately. A node status reported by ConfigNode does not prove that an existing client has refreshed its endpoint snapshot or recovered its connection.
- For locally stopped nodes, use
EnvUtils.getNodeStatusAfterLocalStop()where applicable; graceful process termination behaves differently on Unix and Windows. Use the appropriate status expectation for forced termination. - Keep connection/socket timeouts distinct from query timeouts and the overall assertion deadline. Allow for startup and election costs on CI; use deliberately short timeouts only when needed by the scenario. Do not retry non-idempotent setup statements just to hide a short timeout.
- For tests that require a stale discovery snapshot or a particular failover order, control background refresh and assert the preconditions before triggering recovery.
- Investigate authentication, configuration, and transport failures before increasing a wait timeout. A retained client snapshot can mean that discovery never succeeded. Include useful endpoint/status context and preserve underlying failures when adding diagnostics.
- Do not label a failure as environmental or intermittent based only on one failed run.
Isolation and assertions
- Reuse existing test classes and fixtures, and share cluster startup and teardown across compatible cases within a class or suite whenever possible. Avoid starting and stopping a cluster for each test method or creating an extra cluster when an existing test cluster can cover the scenario. Use a separate cluster or restart only when required by the tested lifecycle, topology, configuration, or isolation.
- Keep tests that share a cluster independent of execution order: isolate their data and restore changed state or configuration using the repository's test helpers. Wait for asynchronous cleanup effects, such as quota accounting after schema deletion, before the next method's setup; successful cleanup SQL alone does not prove that dependent cluster state has converged.
- Close sessions, pools, and result sets; shut down test-owned executors and clean the cluster
even when assertions fail. Use try-with-resources and
finallyas appropriate. - Assert the behavior under test and its recovery result. Only tolerate expected cleanup errors in narrowly scoped cleanup code; do not swallow failures from the operation being verified.
- When enabling an old test or changing its expected result, verify the current intended client/server contract and preserve the original regression input and execution path. For an expected rejection, assert the specific exception and status/message so that an unrelated transport or setup failure cannot satisfy the test.
- Do not weaken assertions, remove cluster categories, or add
@Ignoremerely 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. - Account for platform semantics in process-exit assertions: POSIX exposes only the low 8 bits
of an exit status. When checking a portable process status derived from a
TSStatusCode, compare the low 8 bits of both values (& 0xFF); keep full status-code checks for RPC responses.
Result ordering across DataNodes
- When row order is not part of the query's contract and may differ across DataNodes, use
TestUtils.treeResultSetEqualTestUnordered(sql, expectedHeader, expectedRetArray)for tree-model SQL cases, orTestUtils.tableResultSetEqualTestUnordered(sql, expectedHeader, expectedRetArray, database)for table-model SQL cases (databasemay benullwhen noUSEis needed). When the test already owns a result set, useTestUtils.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. - These helpers check every node independently, including headers, values, and duplicate counts.
They use
ClusterTestResultSet.getNodeResultSetsto read each DataNode's underlying result set. The defaultClusterTestResultSetcompares 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. - Keep ordered assertions when SQL guarantees the final result order. For
LIMIT/OFFSET, ensure the selected rows are deterministic before applying unordered equality; sorting cannot repair a nondeterministic subset. Add sufficientORDER BYtie-breakers when needed.
Verification
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.
Selection check
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- The check detects non-matching class names, missing effective categories, and missing or
duplicated shard candidates. Also inspect the intended profile's
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.testdoes not prove default CI discovery. - When editing CI sharding, reuse
.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 usingfailsafe.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.
Targeted test runs
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-testsUse -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.
- Check
integration-test/target/failsafe-reportsto 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. - For changes involving distributed state in tests enabled for both single- and multi-DataNode profiles, verify the affected cases in both profiles. A 1C1D pass does not establish 1C3D behavior.
- Report the tested revision, edition, profile, and result accurately. Passing an upstream build does not establish that the corresponding downstream edition was tested.
Node templates and IDE runs
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-testsThe 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.
Edge tests
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-testsTrending
More talk lately.about the whole repository
Who's talking about apache/iotdb
- A Hacker News story“Apache IoTDB”Hacker News · Feb 5, 2022 · 3 points
- @bearstech.com“Apache IoTDB : une base de données spécialement conçue pour les time series avec une intégration fluide …”Bluesky · Sep 16, 2024 · 2 likes
- OpenAPITools/openapi-generator“[BUG] openapi-generator-maven-plugin generates incorrect package import for go-server”GitHub · Jan 14, 2021 · 1 reactions
- ePlus-DEV/free-tier-hub“[catalog-candidate] apache-iotdb-self-hosted”GitHub · Oct 28, 2026
- apache/nifi“NIFI-16340 - Bump Netty to 4.2.18.Final, Bouncycastle to 1.86, and others”GitHub · Sep 14, 2026
The biggest 5 of 28 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 28
Talked about on GitHub, Bluesky and Hacker News (28 times).
On GitHub · 23
- Jan 14, 2021[BUG] openapi-generator-maven-plugin generates incorrect package import for go-server — OpenAPITools/openapi-generator1 reaction · 2 comments
- Oct 28, 2026[catalog-candidate] apache-iotdb-self-hosted — ePlus-DEV/free-tier-hub0 reactions · 3 comments
- Sep 14, 2026NIFI-16340 - Bump Netty to 4.2.18.Final, Bouncycastle to 1.86, and others — apache/nifi0 reactions
- Jul 8, 2026NIFI-16095 - Bump Jetty to 12.1.11, Jackson to 2.22.1, and others — apache/nifi0 reactions
- Apr 13, 2026NIFI-15832 - Bump AWS SDK to 2.42.33, Azure SDK to 1.3.6, LZ4 Java to 1.11.0, and others — apache/nifi0 reactions
18 more on GitHub
- Apr 13, 2026Update Cluster UDF in UDF-Libraries — apache/iotdb-docs0 reactions
- Mar 4, 2026NIFI-15672 - Bump AWS SDK to 2.42.6, GCP SDK to 26.77, Fabric8 k8s to 7.6.0, and others — apache/nifi0 reactions
- Feb 6, 2026Fix SessionPool client leak on reconnection and query failures, and preserve server error messages — apache/iotdb-client-csharp0 reactions
- Sep 3, 2025An OOM problem reported by DisposableServer — reactor/reactor-netty0 reactions · 11 comments
- Jun 29, 2025在 Apache IoTDB 中实现 Camel 算法 — yoyo185644/camel0 reactions
- Apr 25, 2025docker:支持在docker-compose文件中使用环境变量配置JVM内存参数 — apache/iotdb-docs0 reactions
- Jan 5, 2025Cannot read field "nextClass" — tsantalis/RefactoringMiner0 reactions · 2 comments
- Oct 9, 2024Support new data types STRING, BLOB, DATE and TIMESTAMP — apache/iotdb-client-csharp0 reactions · 1 comment
- Sep 30, 2024Fix tablet isNull method not correct — apache/tsfile0 reactions · 1 comment
- Sep 19, 2023[pixels CI] Implement github CI for pixels — pixelsdb/pixels0 reactions · 1 comment
- Feb 10, 2023Add IoTDB — TrivadisPF/platys-modern-data-platform0 reactions
- Sep 22, 2022Bump iotdb-server from 0.9.1 to 0.13.1 — ColinWilcoxen/pc10 reactions
- Sep 22, 2022Bump iotdb-server from 0.12.0-SNAPSHOT to 0.13.1 in /khkw_iotdb/No9udf — sunjincheng121/know_how_know_why0 reactions
- Sep 22, 2022build(deps): bump iotdb.version from 0.13.0 to 0.14.0-preview2 — TheOneandOnlyJakfrost/plc4x0 reactions
- Aug 21, 2022build(deps): bump iotdb.version from 0.13.0 to 0.14.0-preview1 — unsun/plc4x0 reactions · 2 comments
- Jun 24, 2022build(deps): bump iotdb.version from 0.12.4 to 0.13.0 — ChinaOpenClaw/plc4x0 reactions · 1 comment
- May 23, 2022build(deps): bump iotdb.version from 0.12.4 to 0.13.0 — RalfBarkow/plc4x0 reactions
- May 12, 2022Apache IoTDB贡献指南 — weopenprojects/WeOpen-Star0 reactions
On Bluesky · 4
- Sep 16, 2024Apache IoTDB : une base de données spécialement conçue pour les time series avec une intégration fluide dans les écosystèmes Hadoop et… — @bearstech.com2 likes and reposts
- Sep 16, 2024今日のGitHubトレンド apache/iotdb IoTDBはApache Software Foundationが開発した時系列データベースです。 IoTデータの保存、クエリ、分析に最適化されており、様々なアプリケーションに利用できます。… — @dailygithubtrends.bsky.social0 likes and reposts · 1 reply
- Sep 15, 2024🚀 Skyrocketing! 🚀 (200+ new stars) 📦 apache / iotdb ⭐ 5,382 (+267) 🗒 Java Apache IoTDB — @github-trending.bsky.social0 likes and reposts · 1 reply
- Sep 16, 2023🚀 Skyrocketing! 🚀 (200+ new stars) 📦 apache / iotdb ⭐ 3,873 (+277) 🗒 Java Apache IoTDB — @github-trending.bsky.social0 likes and reposts · 1 reply
On Hacker News · 1
- Feb 5, 2022Apache IoTDB3 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- distribution/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

