CryoThrust commented on PR #12156: URL: https://github.com/apache/seatunnel/pull/12156#issuecomment-5724637153
@SEZ9 both answers are now in the branch rather than described — head is `2b0624991`. **F1 single snapshot — now pinned deterministically.** You were right that a quiescent test can't tell the two apart, so I took your mock-IMap suggestion. `testCancelJobCommitsToTheJobStatusSnapshotItValidated` swaps in a map that answers `PENDING` on the first read and `RUNNING` on every read after that, then asserts `set(jobId, CANCELED)` happened and `set(jobId, CANCELING)` never did. On the current code it passes; reverting *only* `cancelJob()` to the second read makes it fail with `iMap.set(<jobId>, CANCELING)` at the `never()` assertion, and the log line reads `turned from state RUNNING to CANCELING` — i.e. exactly the divergence F1 removed. The injected map is installed over the final `runningJobStateIMap` field, which is the same route the existing tests in that class already take for `checkpointManager`. **F1 null state — asserted, not inferred.** `testCancelJobOnClearedJobStatusFailsAtTheEndStateGuard` removes the entry and asserts `cancelJob()` throws NPE. That is the pre-existing behaviour you and DanielLeens both described: `getJobStatus()` is a bare map read and `isEndState()` dereferences the result, identical in `stopJob()` and identical before this PR (the old ordinal check sat behind the same guard). I did not change it, since making it a no-op or a cancel would be a behaviour change outside F1's scope — but it's now pinned, so if someone later wants to fix it the test will tell them they're changing something deliberate. I also tightened the comment on the two classification tests so they no longer read as claiming the single-snapshot property — that now lives in its own test. `StateTransitionCleanupTest`: 7 run, 0 failures. Spotless clean. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
