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

   ## Purpose of the pull request
   
   `CommittedMetricsIT` samples the job REST metrics at fixed offsets from job 
start (`Thread.sleep(5000)`, `8000`, `12000`) to observe three checkpoint 
phases of a streaming job whose checkpoint interval is 10s. Under CI load the 
job takes an unpredictable time to start writing / to complete checkpoints, so 
the sampling frequently lands in the wrong phase and the assertions fail 
intermittently (e.g. `writeBeforeCP > 0` before any row is written, or 
`committed > 0` before the first checkpoint finishes).
   
   This PR replaces the fixed sleeps with bounded `Awaitility` polling for each 
phase's precondition, keeping **all** assertions and expected values unchanged:
   
   - Phase 1 polls until writes have started while the committed count is still 
0 (pre-first-checkpoint sample);
   - Phase 2 polls until the first checkpoint has committed data (`committed > 
0`, same upper-bound invariant);
   - Phase 3 polls until the committed count has advanced past the phase-2 
sample, then runs the full unchanged invariant block.
   
   A small `getJobMetricsResponse()` helper replaces the three copies of the 
REST URL construction. Baseline values are carried between phases via holder 
arrays; their meaning is identical to the previous local variables.
   
   ## Verification
   
   - `./mvnw spotless:apply`
   - `./mvnw -pl 
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base -am -DskipTests 
package`
   
   No assertion / expected value was changed — only how long and how often the 
test waits before evaluating them.
   


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