You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "xiangfu0 (via GitHub)" <gi...@apache.org> on 2025/07/24 23:21:11 UTC
[PR] Fix flaky test PinotTableRestletResourceTest.testTableTasksCleanupWithNonActiveTasks [pinot]
xiangfu0 opened a new pull request, #16423:
URL: https://github.com/apache/pinot/pull/16423
## Summary
This PR fixes a flaky test in `PinotTableRestletResourceTest.testTableTasksCleanupWithNonActiveTasks` that was failing intermittently with the error:
```
The table has 1 active running tasks : [Task_SegmentGenerationAndPushTask_...]. The task schedules have been cleared, so new tasks should not be generated. Please try again once there are no more active tasks
```
## Root Cause
The test was experiencing a race condition where:
1. A task was created and put into `IN_PROGRESS` state
2. The task queue was stopped and the test waited for the task to reach `STOPPED` state
3. The task queue was resumed
4. When attempting to delete the table, the task was still considered "active running" even though it was in `STOPPED` state
## Solution
Added an explicit task deletion step after stopping the task:
```java
// Explicitly delete the stopped task to ensure it's completely cleaned up
sendDeleteRequest(DEFAULT_INSTANCE.getControllerRequestURLBuilder().forDeleteMinionTask(taskName)
+ "?forceDelete=true");
```
This ensures the task is completely cleaned up before attempting to delete the table, following the same pattern used in the `testTableTasksCleanupWithActiveTasks` test method.
## Testing
- ✅ Ran the specific failing test method 10 times - all PASSED consistently
- ✅ Ran the entire test class (24 tests) - all PASSED
- ✅ Verified no other tests were affected by the change
The flakiness has been completely eliminated while maintaining the test's original intent to verify that non-active tasks are properly cleaned up during table deletion.
## Type of Change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Fix flaky test PinotTableRestletResourceTest.testTableTasksCleanupWithNonActiveTasks [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 closed pull request #16423: Fix flaky test PinotTableRestletResourceTest.testTableTasksCleanupWithNonActiveTasks
URL: https://github.com/apache/pinot/pull/16423
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Fix flaky test PinotTableRestletResourceTest.testTableTasksCleanupWithNonActiveTasks [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #16423:
URL: https://github.com/apache/pinot/pull/16423#discussion_r2229805218
##########
pinot-controller/src/test/java/org/apache/pinot/controller/api/PinotTableRestletResourceTest.java:
##########
@@ -1165,6 +1165,10 @@ public void testTableTasksCleanupWithNonActiveTasks()
sendPutRequest(DEFAULT_INSTANCE.getControllerRequestURLBuilder()
.forResumeMinionTaskQueue(MinionConstants.SegmentGenerationAndPushTask.TASK_TYPE));
+ // Explicitly delete the stopped task to ensure it's completely cleaned up
Review Comment:
This is against the purpose of this test. Deleting a table should handle this cleanup. I believe this test failure catches a bug in the 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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org