Skip to content

[Fix][Zeta] Fix flaky pending job info test#10891

Open
QuakeWang wants to merge 1 commit into
apache:devfrom
QuakeWang:fix/pending-job-info-test
Open

[Fix][Zeta] Fix flaky pending job info test#10891
QuakeWang wants to merge 1 commit into
apache:devfrom
QuakeWang:fix/pending-job-info-test

Conversation

@QuakeWang
Copy link
Copy Markdown

@QuakeWang QuakeWang commented May 15, 2026

Purpose of this pull request

Fix flaky CoordinatorServiceTest.testGetPendingJobInfo.

Related CI failure: https://github.com/QuakeWang/seatunnel/actions/runs/25901176569/job/76125357474

The old test submitted a real job and asserted that the job was still in pendingJobQueue. This assertion depended on a transient scheduler state because the coordinator scheduler may consume the pending job immediately after submission.

This patch makes the test deterministic by constructing a controlled pending job and verifying that getJobInfo() can return DAG info from the pending job path.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

git diff --check
./mvnw -pl seatunnel-engine/seatunnel-engine-server -am -Dtest=CoordinatorServiceTest#testGetPendingJobInfo -DfailIfNoTests=false -DskipIT=true -Dskip.spotless=true verify

Check list

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
@github-actions github-actions Bot added the Zeta label May 15, 2026
Copy link
Copy Markdown
Contributor

@DanielLeens DanielLeens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I reviewed the latest head and checked the pending-job path that this test is targeting. This change is test-only, it hits the real pending-queue branch, and I do not see a source-level blocker on the current head.

What this PR solves

  • User pain point
    Pending-job tests that depend on coordinator scheduling timing can fail intermittently, which makes it hard to tell whether the failure is in production logic or in the test itself.
  • Fix approach
    This PR rewrites the test setup to construct pending-job scenarios directly with helpers instead of depending on asynchronous timing.
  • One-line summary
    This is a focused test-stability fix for the pending-job path, and I do not see a source-level blocker on the latest head.

Runtime path I checked

CoordinatorService.getJobInfo(jobId) [CoordinatorService.java:1393-1407]
  -> history lookup
  -> runningJobMasterMap lookup
  -> pendingJobQueue.getById(jobId)
  -> runningJobInfoIMap lookup

Key findings

  1. The production path itself is unchanged.
  2. The updated test now targets the real pendingJobQueue branch directly instead of relying on async scheduling to reach that state.
  3. The new helpers (newMockCoordinatorService(...), enqueueMockPendingJob(...)) make the scenario easier to reason about and less timing-sensitive.
  4. I do not see a source-level blocker on the latest head.

Test / CI notes

  • The test structure is healthier than before: it uses mocks and condition-based waiting rather than adding new fixed sleeps.
  • The current Build signal is incomplete because the latest run was cancelled, and changes did not finish cleanly before the matrix fan-out, so CI needs a clean rerun before merge.

Conclusion: can merge after fixes

  1. Blocking items
  • Please rerun the latest CI and get Build green before merge.
  1. Suggested but non-blocking improvements
  • No new source-side changes are required from my side on this revision.

Overall, this looks like a good test-only cleanup for the pending-job path. I do not have a source-level blocker on the current head; the remaining gate is CI completeness.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants