Skip to content

[CELEBORN-2436] Speed up slow tests and fix LifecycleManager leaks in spark-it - #3817

Open
yew1eb wants to merge 2 commits into
apache:mainfrom
yew1eb:CELEBORN-2436
Open

[CELEBORN-2436] Speed up slow tests and fix LifecycleManager leaks in spark-it#3817
yew1eb wants to merge 2 commits into
apache:mainfrom
yew1eb:CELEBORN-2436

Conversation

@yew1eb

@yew1eb yew1eb commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Test-only changes to cut CI wall time:

  1. DataPushQueueSuiteJ: reduce numPartitions from 1,000,000 to 30,000.
  2. QuotaManagerSuite: reduce case1/case2 scale from 1000 users × 1000 applications to 100 × 100 (and the inner check loop accordingly).
  3. RatisMasterStatusSystemSuiteJ (plus its SSL and gRPC variants): add an awaitCondition(BooleanSupplier) helper (100ms poll interval, 30s upper bound, falls back to the original assertion on timeout) and convert 38 fixed Thread.sleep calls — including the hard 15s leader-election wait — to condition polling. One negative assertion that must observe state not changing keeps a (reduced) fixed wait.
  4. spark-it: stop leaked LifecycleManager/ShuffleClient instances in LifecycleManagerReserveSlotsSuite, LifecycleManagerSuite and ChangePartitionManagerUpdateWorkersSuite. The key fix is adding the missing super.afterEach() in ChangePartitionManagerUpdateWorkersSuite: its parent WithShuffleClientSuite creates LifecycleManagers via prepareService() and relies on the trait's afterEach to stop them, so the override leaked 4 LifecycleManagers permanently.

Why are the changes needed?

Several tests dominate CI time due to artificial data scale, fixed sleeps, and leaked LifecycleManagers whose app-heartbeat threads keep flooding AskSync HeartbeatFromApplication failed for the rest of the forked JVM (forkMode=once), stealing CPU from subsequent suites.

Measured locally:

  • DataPushQueueSuiteJ: 28min → ~56s
  • QuotaManagerSuite: ~11min → ~3s
  • RatisMasterStatusSystemSuiteJ: 3×180s → 3×~53s
  • Full spark-it run: BUILD SUCCESS, HeartbeatFromApplication failed drops from a continuous storm to 6 benign shutdown-race occurrences
  • Full sbt test run: 25m26s

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

How was this patch tested?

  • All modified suites pass locally: DataPushQueueSuiteJ 2/2, QuotaManagerSuite 7/7, RatisMasterStatusSystemSuiteJ + SSL + gRPC variants all green
  • Full tests/spark-it run (-Pspark-3.5): BUILD SUCCESS
  • Full sbt test run passes (two pre-existing macOS-local environment failures unrelated to this change: EPOLL/KQUEUE config test and an SSL data-writer test)
  • spotless:check passes for all touched modules

… spark-it

- DataPushQueueSuiteJ: reduce numPartitions from 1000000 to 30000 (28min -> ~56s)
- QuotaManagerSuite: reduce case1/case2 scale from 1000x1000 to 100x100 (~11min -> ~3s)
- RatisMasterStatusSystemSuiteJ: replace fixed sleeps with awaitCondition polling (3x180s -> 3x~53s)
- spark-it: stop leaked LifecycleManager/ShuffleClient instances, and add the missing
  super.afterEach() in ChangePartitionManagerUpdateWorkersSuite so the LifecycleManagers
  created by the inherited WithShuffleClientSuite tests are stopped, eliminating the
  ~1h 'HeartbeatFromApplication failed' storm that stole CPU from subsequent suites
…ed one

isLeader() returns true as soon as a node wins the election, but the leader
rejects writes with LeaderNotReadyException until the no-op log entry for the
new term is committed. Poll isLeaderReady() so tests do not race the readiness
window on slower CI runners.
@yew1eb yew1eb closed this Aug 20, 2026
@yew1eb yew1eb reopened this Aug 20, 2026
@yew1eb yew1eb closed this Aug 20, 2026
@yew1eb yew1eb reopened this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant