This directory contains Session and subscription E2E tests in the main Go module. It requires Go 1.25 or later.
Run subscription unit tests from the repository root:
go test ./subscription/...
Run all Session and subscription E2E tests from the repository root:
go test -v ./test/e2e
The subscription cases are discovered by the normal test run but skip unless IOTDB_SUBSCRIPTION_E2E=1 is set.
cd "$(git rev-parse --show-toplevel)" IOTDB_SUBSCRIPTION_E2E=1 \ IOTDB_E2E_NODE_URLS=iotdb:6668,iotdb:6667,iotdb:6669 \ IOTDB_E2E_USERNAME=root \ IOTDB_E2E_PASSWORD=root \ go test -v -run '^TestSubscription' ./test/e2e
| Environment variable | Default | Description |
|---|---|---|
IOTDB_SUBSCRIPTION_E2E | Unset; subscription tests skip | Exactly 1 enables subscription tests |
IOTDB_E2E_NODE_URLS | iotdb:6668,iotdb:6667,iotdb:6669 | Comma-separated Session/subscription seed addresses |
IOTDB_E2E_USERNAME | root | Shared user name; IOTDB_USERNAME is a fallback |
IOTDB_E2E_PASSWORD | root | Shared password; IOTDB_PASSWORD is a fallback |
An explicitly empty password remains empty. Whitespace around node addresses is ignored.
Use an IoTDB server with subscription support enabled. Incremental tests additionally require WAL subscriptions and a compatible consensus protocol.
The Docker server startup script enables subscription_enabled and assigns a nonzero subscription share in chunk_timeseriesmeta_free_memory_proportion. A separately managed server needs equivalent configuration sized for its available memory and subscription queues.
Subscription tests fail on connection errors, disabled subscription support, unsupported Topic modes, and unavailable WAL features. An empty poll is not treated as successful delivery.
The existing Session E2E suites use the Docker hostname iotdb and fixed single-node Table settings. Run those suites inside the Docker Compose network or provide equivalent host resolution and service availability.
Session and subscription tests share config_test.go. The shared environment variables support external deployments while keeping subscription tests opt-in.
subscription_tree_test.go covers:
SeekToBeginning and checkpoint reusesubscription_table_test.go covers:
Each test uses unique resource names and closes consumers before dropping topics and data. Subscription operations use bounded contexts, including independent cleanup contexts.
The single-node Compose fixture does not exercise:
Those scenarios require multi-node or host-side fault orchestration.
The repository Makefile prepares an IoTDB distribution and starts test/e2e/docker-compose.yml:
make e2e_test
make e2e_test_clean
The client container runs the test/e2e package from the root module. IOTDB_E2E_* and IOTDB_SUBSCRIPTION_E2E are passed into the container when set. Unset values use the defaults described above.
See the subscription client guide for API contracts and connection defaults.