Skip to content

[#14003] improvement(test): Skip durability work in test containers per fixture - #14013

Open
nevzheng wants to merge 15 commits into
apache:mainfrom
nevzheng:claude/13900-tc-09-durability
Open

nevzheng wants to merge 15 commits into
apache:mainfrom
nevzheng:claude/13900-tc-09-durability

Conversation

@nevzheng

@nevzheng nevzheng commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What changes were proposed in this pull request?

  • durability = DISPOSABLE (default) | DURABLE on every fixture; each container applies its own recipe when it starts. A durable container is private (scope = CLASS | METHOD), which only @HiveFixture with HDFS storage supports so far; other fixtures fail when the class is found.
  • Hive keeps HDFS on tmpfs and its metastore MySQL skips per-commit flushes, for consistency with the other services (no measurable gain on a local Mac; CI disks may differ); ZooKeeper sets forceSync=no; MySQL and PostgreSQL use [#13515] improvement(test): Speed up the core MySQL and PostgreSQL test lanes with disposable database data #13899's settings in every module.
  • Ranger keeps its policies in the shared MySQL instead of the MariaDB in its image, as a rangeradmin user limited to its own database.
  • -PdurableTestContainers makes every container durable, for debugging.

This PR includes the commits of the PRs below it. Review only its own commit: nevzheng/gravitino@claude/13900-tc-08-trino-cluster...claude/13900-tc-09-durability It also carries #13899's commits; they drop out once #13899 merges.

Why are the changes needed?

Part of the MySQL gain also comes from replacing Testcontainers' bundled my.cnf (16 MB buffer pool, table_open_cache = 4), which applies in durable mode too.

No test reads data back after a container stops, so syncing to disk is wasted work. #13899 measured MySQL 2.0x and PostgreSQL 1.4x faster on the core lanes; this extends it to every module. Locally, idp-basic (MySQL, PostgreSQL) runs about 55 % faster with disposable data and catalog-jdbc-mysql about 22 %.

Fix: #14003

Does this PR introduce any user-facing change?

No. Test code only.

How was this patch tested?

Unit tests; the same modules run with durability on and off.

Stack: #14103 → #14083 → #14084 → #14085 → #14005 → #14006 → #14052 → #14076 → #14007 → #14008 → #14009 → #14010 → #14011 → #14012 → #14013 → #14079 → #14077 → #14078 → #14086 → #14087 → #14088 → #14089 → #14090 → #14091 → #14094

@github-actions

Copy link
Copy Markdown

Code Coverage Report

Overall Project 72.34% 🟢
Files changed No Java source files changed -

Module Coverage
aliyun 19.74% 🔴
api 55.09% 🟢
authorization-common 85.96% 🟢
authorization-ranger 14.44% 🔴
aws 60.78% 🟢
aws-bundle 0.0% 🔴
azure 68.04% 🟢
azure-bundle 0.0% 🔴
catalog-common 29.49% 🔴
catalog-fileset 82.37% 🟢
catalog-glue 73.24% 🟢
catalog-hive 84.5% 🟢
catalog-jdbc-common 58.22% 🟢
catalog-jdbc-doris 87.94% 🟢
catalog-jdbc-mysql 84.91% 🟢
catalog-jdbc-postgresql 83.76% 🟢
catalog-jdbc-starrocks 79.72% 🟢
catalog-kafka 75.21% 🟢
catalog-lakehouse-generic 86.91% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 86.87% 🟢
catalog-lakehouse-paimon 84.36% 🟢
catalog-model 77.99% 🟢
cli 44.62% 🟢
client-java 79.44% 🟢
client-java-runtime 0.0% 🔴
common 60.9% 🟢
core 87.57% 🟢
filesystem-hadoop3 76.89% 🟢
flink 55.56% 🟢
flink-common 32.39% 🔴
flink-runtime 0.0% 🔴
gcp 32.2% 🔴
hadoop-auth 68.0% 🟢
hadoop-common 17.84% 🔴
hive-metastore-common 62.3% 🟢
hive-metastore3-libs 58.8% 🟢
iceberg-aliyun-bundle 0.0% 🔴
iceberg-common 67.14% 🟢
iceberg-rest-server 77.45% 🟢
idp-basic 87.03% 🟢
integration-test-common 0.0% 🔴
jobs 71.35% 🟢
k8s-job-executor 97.84% 🟢
lance-common 40.73% 🟢
lance-rest-server 68.04% 🟢
lineage 59.39% 🟢
optimizer 84.27% 🟢
optimizer-api 46.58% 🟢
server 91.44% 🟢
server-common 84.01% 🟢
spark 63.45% 🟢
tencent 81.78% 🟢
tms 80.04% 🟢
trino-connector 64.88% 🟢

Design doc for apache#13900 and a rumdl config for design-docs/testing.
…e ContainerSuite lifecycle

- Log every container start with pull, start and readiness times; add test
  log4j configs so the lines show.
- Reset all ContainerSuite state in close(); key Hive by version; make the
  PostgreSQL retry wait; pin StarRocks; drop a dead start method.
- Poll readiness with no initial delay; run cleanDisk() only on real starts.
- idp-basic starts its containers once per run; Ryuk back on, unprivileged.
- Drop the suite-wide closes in Hive2, Flink and Spark ITs.
@nevzheng
nevzheng force-pushed the claude/13900-tc-09-durability branch from c042d82 to c1b14ec Compare October 22, 2026 04:29
…est containers (part 1/6)

ContainerSpec, ContainerExtension and @FixtureContainer: a test declares a
container with a fixture annotation and receives it as a parameter or field.
Fixtures for Kafka, LocalStack, RustFS, StarRocks, OceanBase and Doris, with
their callers migrated.
…o, Ranger and Hive (part 2/6)

- TestImages declares every test image in one place.
- BaseContainer subclasses can supply their own container (ready for the
  official Testcontainers modules).
- Moto, Ranger and Hive (version, auth) fixtures.
- A container whose start fails is closed instead of leaking.
…add ClickHouse fixtures and scope (part 3/6)

- client-java, fileset, Hudi, Iceberg, Paimon, Iceberg REST, GVFS, Flink,
  Spark and Trino env tests use @HiveFixture.
- ClickHouse (1 or 3 nodes) and ZooKeeper fixtures.
- scope = RUN | CLASS | METHOD; HadoopUserAuthenticationIT gets a private
  Kerberos Hive.
…and PostgreSQL fixtures (part 4/6)

- Review follow-ups from the first fixture changes.
- A fixture annotation on a field picks that field's container.
- startup = EAGER | LAZY; a warning for fixtures no test injects.
- MySQL and PostgreSQL fixtures; SparkQueryRunner starts Hive through its
  spec.
- Only the run's closer closes the container suite.
- Split container start time into pull, start and readiness; give the Hive
  metastore check a real time budget.
…remaining Hive variants (part 5/6)

- ContainerSpec.dependencies(): dependencies start first, deepest first,
  with a cycle check.
- ClickHouseCluster injected for the three-node cluster.
- Hive auth = RANGER and storage = S3 | GCS | ABS; the CatalogHive IT family
  and the Ranger ITs use them.
- HiveUserAuthenticationIT on the Kerberos Hive fixture.
…th TrinoCluster (part 6/6)

TrinoCluster starts the Trino stack through Testcontainers instead of
launch.sh and docker compose, with real readiness checks and Ryuk cleanup.
@TrinoFixture starts lazily and reads the Gravitino server port from the
test.
…ners per fixture

- durability = DISPOSABLE (default) | DURABLE on every fixture; each
  container applies its own recipe at start.
- Hive keeps HDFS on tmpfs and its metastore MySQL skips per-commit
  flushes, for consistency (no measurable gain on a local Mac); ZooKeeper
  sets forceSync=no; MySQL and PostgreSQL use apache#13899's settings everywhere.
- Ranger keeps its policies in the shared MySQL.
- -PdurableTestContainers makes every container durable, for debugging.

Builds on apache#13899.
@nevzheng
nevzheng force-pushed the claude/13900-tc-09-durability branch from c1b14ec to 531b0a5 Compare October 22, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask] Skip durability work in test containers

1 participant