Skip to content

[Subtask] Run core database test lanes with bounded adaptive forks #13529

Description

@nevzheng

Describe the subtask

Run the explicit H2, MySQL, and PostgreSQL core lanes with conservative Gradle worker-level concurrency after #13518 establishes class-scoped fixture ownership. The goal is to reduce lane wall time without enabling JUnit method-level parallelism or sharing database servers between workers.

The change should:

  • derive maxParallelForks from CPU, JVM-visible memory, Gradle worker capacity, concurrently selected database lanes, and a conservative rollout cap;
  • support strict property and environment overrides, enforce every known bound, and fall back to one worker when automatic resource signals are incomplete;
  • retain one worker for macOS fixed-network Docker configurations;
  • add exact-type DatabaseTestContext injection for the selected backend and isolation policy;
  • preserve [#6505] improvement(test): Reuse core database fixtures by test class #13518’s cleanup, poisoning, rebuild, and fresh-fixture semantics within each worker;
  • keep JUnit method-level parallelism disabled;
  • emit per-worker and per-class [CORE-DB-SHARD] telemetry in each lane’s evidence artifact; and
  • add focused policy, injection, and telemetry regression tests.

Acceptance criteria:

  • Unit, H2, MySQL, and PostgreSQL lanes pass, and every database lane preserves the exact test identity/count baseline from [#6505] improvement(test): Reuse core database fixtures by test class #13518.
  • Every Gradle test worker owns its database server; no server or connection pool is shared across workers.
  • The selected worker count never exceeds any known CPU, memory, Gradle-worker, selected-lane, or rollout bound.
  • Malformed, non-positive, overflowing, and above-bound overrides fail with actionable errors; incomplete automatic signals select one worker.
  • The macOS fixed-network Docker guard selects one worker where applicable.
  • Matched before/after runs report task duration, worker count, fixture initialization count, and container-start count.

Connection pooling, shared database servers, namespace sharding, and method-level parallelism are out of scope.

Depends on #13518. Related to #13517.

Parent issue

#13515

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    subtaskSubtasks of umbrella issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions