Stabilize the pending-job scheduler regression test
Removed a timing-sensitive coordinator test race by replacing Awaitility polling with a latch signalled directly when the pending-job scheduler enters the mocked resource-check method.
apache/seatunnel · #12013
CI reliability fix
SeaTunnel's coordinator regression test now synchronizes on the exact scheduler-entry event instead of polling an in-progress Mockito invocation on loaded Java 8 runners.
Problem
The regression test polled Mockito while `preApplyResources()` was still executing on another thread. Under load on Java 8 CI, invocation bookkeeping could miss the five-second polling window even though the scheduler had entered the expected path, producing a false timeout rather than a product failure.
Approach
Introduced a `CountDownLatch` at the exact scheduler-entry point and made the test wait on that event with a bounded, descriptive assertion before clearing the coordinator. The approach matches the synchronization pattern already used by adjacent scheduler tests and leaves production scheduling behavior unchanged.
Impact and scope
- Prevents a known false-negative failure from obscuring real SeaTunnel Zeta regressions on loaded CI workers.
- Replaces indirect polling with event-driven thread coordination tied to the behavior the test actually needs to observe.
- Makes the coordinator test suite more deterministic across Java 8 and Java 11 without weakening its cleanup assertions.
Validation
- Ran the focused regression five consecutive times on Java 8 and the complete 35-test coordinator class on Java 8 and Java 11.
- Verified the 40-module Java 8 reactor path and the final Apache Build, including the unit-test job associated with the original failure.
- The authored commit and GitHub-verified merge commit credit Goutam Adwant; the fix received upstream approval and closed GH-12012.