xiangfu0 opened a new pull request, #18260:
URL: https://github.com/apache/pinot/pull/18260

   ## Summary
   
   Extends the polling pattern introduced in #18253 (for 
`mergeRollupTaskNumBucketsToProcess`) to the remaining five 
`mergeRollupTaskDelayInNumBuckets.*` `gaugeExists` checks in the same test 
class.
   
   ## Root cause
   
   The gauge is registered by 
`MergeRollupTaskGenerator.createOrUpdateDelayMetrics` and removed by 
`resetDelayMetrics` when a `scheduleTasks` call observes no eligible segments 
for the table. Each per-iteration body's
   
   ```java
   
assertNull(_taskManager.scheduleTasks(context).get(MinionConstants.RealtimeToOfflineSegmentsTask.TASK_TYPE));
   ```
   
   probe triggers an extra synchronized `scheduleTasks` that can race with the 
previous merge task's segment-lineage commit — transiently reaching the 
`resetDelayMetrics` branch and removing the gauge. The post-loop 
`assertTrue(MetricValueUtils.gaugeExists(...))` then flakes on the same window 
that #18253 addressed for the processAll-mode test.
   
   ## Fix
   
   Added a `waitForGaugesToExist(String...)` helper that polls via 
`TestUtils.waitForCondition` with the existing `TIMEOUT_IN_MS`, mirroring 
`waitForExpectedNumBucketsToProcess` introduced in #18253. Replaced the 
`assertTrue(gaugeExists(...))` calls in:
   
   - `testOfflineTableSingleLevelConcat`
   - `testOfflineTableSingleLevelConcatWithMetadataPush`
   - `testOfflineTableSingleLevelRollup`
   - `testOfflineTableMultiLevelConcat` (polls `45days` + `90days` atomically)
   - `testRealtimeTableSingleLevelConcat`
   
   ## Test plan
   
   - [x] `./mvnw test-compile -pl pinot-integration-tests -am` passes.
   - [x] `./mvnw spotless:apply checkstyle:check license:format license:check 
-pl pinot-integration-tests` clean.
   - [ ] CI runs `MergeRollupMinionClusterIntegrationTest` successfully across 
multiple runs.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to