Repository navigation
[Fix][Zeta] Fix undefined job event timeout constant - #11954
Conversation
davidzollo
left a comment
There was a problem hiding this comment.
+1 if CI passes.
Good job
DanielLeens
left a comment
There was a problem hiding this comment.
What Problem Does This PR Solve?
JobStateEventTest.java currently fails to compile on dev because it references an undefined symbol, FAILED_JOB_EVENT_TIMEOUT_SECONDS, in testNotEndJobStateEvent(). This PR fixes the compile break by pointing that single remaining usage at the already-imported, still-valid RESTORE_TO_FAILED_TIMEOUT_SECONDS constant. One-sentence summary: fixes a genuine, currently-live compile error in seatunnel-engine-server's test sources by completing an incomplete rename from a prior commit.
1. Code Change Review
1.1 Core Logic Analysis
The diff is a single line in seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/event/JobStateEventTest.java:165:
- await().atMost(FAILED_JOB_EVENT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
+ await().atMost(RESTORE_TO_FAILED_TIMEOUT_SECONDS, TimeUnit.SECONDS)I did not take the PR title's "undefined constant" claim at face value — I traced it end-to-end against dev HEAD (406c66789):
- Confirmed
FAILED_JOB_EVENT_TIMEOUT_SECONDShas no declaration anywhere inJobStateEventTest.javaondev(no local field, no static import, no wildcard import) — it appears exactly once, at the line this PR changes. That meansseatunnel-engine-server's test-compile module is currently broken ondev; any CI job that compiles this module's tests is red right now, independent of this PR. - Traced the root cause via
git log: commit033612bfd("[Fix][E2E] Address follow-up review issues for CI stabilization", PR #11097) removed the local fieldprivate static final long FAILED_JOB_EVENT_TIMEOUT_SECONDS = 240L;and added the static importCheckpointErrorRestoreEndTest.RESTORE_TO_FAILED_TIMEOUT_SECONDS, then rewired the usage insidetestJobStateEvent()(line 94) to the new constant — but missed the structurally identical second usage inside the sibling test methodtestNotEndJobStateEvent()(line 165), which kept referencing the now-deleted field. This PR completes that incomplete rename. - Verified
RESTORE_TO_FAILED_TIMEOUT_SECONDSispublic static final long ... = 240LinCheckpointErrorRestoreEndTest.java:42— the exact same numeric value (240 seconds) as the field that was deleted. So this is not just a compile fix, it's a semantically neutral one: the wait timeout for "job transitions to FAILED afterSTREAM_CONF_WITH_ERROR_PATHis submitted" is unchanged at 240s in both test methods, before and after. - Confirmed both usages are structurally parallel:
testJobStateEvent()(already fixed, line 94) andtestNotEndJobStateEvent()(this PR's fix, line 165) both dostartJob(jobIdFailed, STREAM_CONF_WITH_ERROR_PATH, false)followed immediately byawait().atMost(<timeout>, SECONDS).untilAsserted(() -> assertEquals(JobStatus.FAILED, ...)). The fix makes the second method consistent with the first rather than introducing new behavior.
Runtime path (test-only, no production code involved):
mvn test-compile (seatunnel-engine-server)
-> javac JobStateEventTest.java
-> [before fix] symbol FAILED_JOB_EVENT_TIMEOUT_SECONDS not found -> COMPILE ERROR, module test-compile fails
-> [after fix] RESTORE_TO_FAILED_TIMEOUT_SECONDS resolves via static import from CheckpointErrorRestoreEndTest -> compiles
-> testNotEndJobStateEvent() runs: startJob(..., STREAM_CONF_WITH_ERROR_PATH, false)
-> await up to 240s for CoordinatorService.getJobStatus(jobId) == FAILED
Key Finding: this is purely a test-source compile fix. No src/main/java file is touched, no engine runtime behavior, checkpoint/restore logic, event dispatch, or serialization is affected. The "job event timeout" in the PR title refers only to a test's Awaitility wait bound, not to any engine-level timeout configuration.
1.2 Compatibility Impact
Fully compatible. Zero production code changed; this cannot affect any deployed job, checkpoint/savepoint format, serialization, or public API/SPI contract by construction — it only affects whether the test module compiles.
1.3 Performance / Side-Effect Analysis
None. Test-only change, and the effective timeout value (240s) is unchanged from what the deleted field previously specified.
1.4 Error Handling and Logging
No blocking issues found. This is a minimal, correctly-scoped fix for a genuine compile error, verified by direct symbol-resolution analysis rather than by trusting the PR description.
2. Code Quality Assessment
2.1 Coding Standards
Consistent with the existing static-import style already used in this file for RESTORE_TO_FAILED_TIMEOUT_SECONDS and STREAM_CONF_WITH_ERROR_PATH (both imported from CheckpointErrorRestoreEndTest). No new methods or fields are introduced, so no new Javadoc is required.
2.2 Test Coverage and Test Stability
Stability rating: Stable. The change swaps one already-proven-stable constant (RESTORE_TO_FAILED_TIMEOUT_SECONDS, already in active use one test method earlier in the same file, at line 94) into a second, structurally identical usage. It does not introduce Thread.sleep, does not change assertion determinism, does not touch shared static state beyond a static import (a compile-time binding, not shared mutable state), and does not reorder or weaken any existing assertion — the Awaitility atMost/untilAsserted pattern and the 240s bound are both preserved exactly as they were before the constant went missing. Since the file currently fails to compile on dev, this fix is a strict net-positive for CI stability: it restores the ability to compile and run testNotEndJobStateEvent() at all, with no weakening of what is being asserted.
2.3 Documentation Updates
Not applicable — internal test constant reference, no user-facing behavior or configuration involved.
3. Architectural Soundness
3.1 Elegance of the Solution
Precise fix — reuses an existing, already-imported, semantically-equivalent constant rather than reintroducing a duplicate field or a new magic number. This is the minimal correct fix; re-adding a separate FAILED_JOB_EVENT_TIMEOUT_SECONDS = 240L field would have been a viable alternative but strictly worse (duplicates a value that already exists as RESTORE_TO_FAILED_TIMEOUT_SECONDS).
3.2 Maintainability
Improves maintainability by removing a dangling, unresolvable symbol reference and consolidating on the one shared timeout constant already used elsewhere in the same file for the identical wait condition.
3.3 Extensibility
N/A for a one-line test fix.
3.4 Historical-Version Compatibility
N/A — test-only change with no effect on serialized state, checkpoints, or upgrade paths.
4. Issue Summary
No blocking or non-blocking issues identified.
5. Merge Recommendation
Conclusion: Ready to merge
- Blockers — none.
- Recommended fixes — none.
Overall assessment: I agree with @dybyte's, @goutamadwant's, and @davidzollo's existing approvals, all of which are conditioned on "if CI passes." I went further and independently confirmed why CI needs this fix: dev currently has a real compile error in seatunnel-engine-server's test sources (FAILED_JOB_EVENT_TIMEOUT_SECONDS is genuinely undefined, traced to an incomplete rename in commit 033612bfd / PR #11097), and this PR's one-line change is the exact, minimal, semantically-neutral fix for it (same 240s timeout, same already-imported constant already proven correct one test method earlier in the same file). No production code is touched, so there is no compatibility or runtime-behavior risk to evaluate beyond the test module compiling and passing. My own review of the code independently corroborates the prior approvals rather than duplicating their reasoning — I'm not aware of any additional risk they missed.
CI diagnosis: at the time of this review, the apache-side "Build" check for this PR (https://github.com/apache/seatunnel/runs/97323739926) is still pending, and mergeStateStatus is BLOCKED pending that check plus branch protection. Given the root cause traced above, I expect this to go green once the fork's CI run completes — there is no remaining source-level reason for it to fail. No action needed from the author beyond waiting for/re-checking the pending run.
Purpose of this pull request
Fix the scheduled benchmark build failure in GitHub Actions run 32676735991.
What is changed
FAILED_JOB_EVENT_TIMEOUT_SECONDSconstant.RESTORE_TO_FAILED_TIMEOUT_SECONDSconstant already imported byJobStateEventTest.The earlier refactor replaced only the first reference, leaving the second reference undefined and causing
seatunnel-engine-servertest compilation to fail on both Java 8 and Java 11.Validation
./mvnw spotless:applygit diff --check