zhangshenghang opened a new pull request, #13518:
URL: https://github.com/apache/seatunnel/pull/13518

   Yes — I am contributing this test to Apache SeaTunnel.
   
   ## What this changes
   
   Adds one Zeta engine boundary E2E, `SiblingJobIsolationOnCancelIT`, plus the 
two small job configs it needs. Test-only: no engine, connector or 
configuration production code is touched. No engine defect was found while 
writing it, so there is no issue to reference; this PR ships the regression 
guard on its own.
   
   ## Contract under test
   
   A single master-and-worker node advertises 6 fixed slices (`dynamic-slot: 
false`, `slot-num: 6`, `job-schedule-strategy: WAIT`). Two long-lived streaming 
jobs each own 3 of them: a `FakeSource` reader at parallelism 1, its split 
enumerator, and the `InMemory` sink task group. The sibling job's sink sets 
`checkpoint_sleep`, so every checkpoint of that job stays in flight for ~5 s of 
its 1 s interval.
   
   The test then:
   
   1. Waits until the sibling job has a checkpoint actually in flight 
(`CheckpointMonitorService` overview `inProgress > 0`) and cancels the first 
job exactly then, so the interesting window is deterministic instead of 
incidental.
   2. Asserts that releasing the cancelled job is job-scoped: every slice it 
owned is freed, the sibling still owns exactly the same slice ids, and only 3 
slices stay assigned on the worker.
   3. Asserts that the sibling's checkpoint chain survives the cancellation: 
the in-flight checkpoint completes, further checkpoints keep completing, its 
checkpoint ids stay unique and increasing, no checkpoint of it is reported 
failed and no pipeline restore of it is recorded. The sibling keeps `RUNNING` 
for a stability window.
   4. Submits a replacement job with the cancelled job's footprint and asserts 
that it starts immediately while the sibling keeps running, that the two 
running jobs never share a slice, and that the replacement starts its own 
checkpoint sequence at id 1 instead of inheriting the cancelled job's counters.
   5. Cancels everything and asserts the whole fixed pool becomes unassigned 
again.
   
   ## Why existing coverage misses it
   
   - `SeaTunnelSlotIT` submits jobs one at a time and only checks that a later 
job finds free capacity.
   - `SavepointBusySourceBarrierIT`, `CheckpointCoordinatorFailoverIT` and 
`SplitClusterPendingJobLifecycleFailoverIT` all let a single job own the worker 
(or fail that one job over).
   - No existing engine E2E asserts that a cancellation is scoped to its own 
job's slices and checkpoint bookkeeping while a second job keeps running next 
to it, which is the state shared slot accounting, slot release and checkpoint 
bookkeeping silently depend on.
   
   ## Verification
   
   ```
   ./mvnw -o -q -pl 
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base \
     -DskipUT=true -DskipIT=false -Dit.test=SiblingJobIsolationOnCancelIT \
     -DfailIfNoTests=false verify
   # 4 consecutive passes, ~26.7 s each
   ```
   
   Negative control: temporarily making `DefaultSlotService#releaseSlot` 
release a slice owned by another job instead of the requested one makes the 
test fail with
   
   ```
   the surviving job must keep exactly the slices it owned ==> expected: <[3, 
4, 5]> but was: <[]>
   ```
   
   (reverted; the pristine engine was reinstalled before the final passing run).
   
   Also run: `./mvnw -o -q -pl <module> spotless:apply`, `./mvnw -o -q -pl 
seatunnel-ci-tools -Dtest=ImportClassCheckTest test`, `git diff --check`.
   


-- 
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]

Reply via email to