-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[test] Fix flaky table cleanup and truncate signed-zero tests #17652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[test] Fix flaky table cleanup and truncate signed-zero tests #17652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a race condition in PinotTableRestletResourceTest#testTableTasksCleanupWithNonActiveTasks that caused flaky test failures. The issue occurred when the minion task queue was resumed before table deletion completed, allowing concurrent task transitions to interfere with cleanup operations.
Changes:
- Move task queue resume logic from before table deletion to after deletion in a
finallyblock - Add explanatory comments describing why the queue must remain stopped during deletion
- Ensure queue resume happens even if deletion fails, preventing test interference
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17652 +/- ##
============================================
+ Coverage 63.22% 63.24% +0.01%
Complexity 1499 1499
============================================
Files 3174 3174
Lines 190319 190332 +13
Branches 29080 29084 +4
============================================
+ Hits 120338 120368 +30
+ Misses 60643 60629 -14
+ Partials 9338 9335 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
...java/org/apache/pinot/core/operator/transform/function/TruncateDecimalTransformFunction.java
Outdated
Show resolved
Hide resolved
...java/org/apache/pinot/core/operator/transform/function/TruncateDecimalTransformFunction.java
Outdated
Show resolved
Hide resolved
...-controller/src/test/java/org/apache/pinot/controller/api/PinotTableRestletResourceTest.java
Show resolved
Hide resolved
.../org/apache/pinot/core/operator/transform/function/TruncateDecimalTransformFunctionTest.java
Outdated
Show resolved
Hide resolved
3d37641 to
e3b021a
Compare
|
Addressed another flake from CI in Validation:
|
| waitForTaskState(taskName, TaskState.IN_PROGRESS); | ||
|
|
||
| // stop the task queue to abort the task | ||
| // Stop the task queue to abort the task. Keep it stopped until table deletion is complete to avoid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test capturing a race condition?
| } else { | ||
| truncated = 0.0d; | ||
| } | ||
| // Normalize -0.0 to +0.0 for deterministic output and test stability. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? This is an actual production fix, suggest putting it in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will separate
Extracted from apache#17652 as a standalone production fix. - Use allocation-free math truncation in no-scale path - Preserve NaN/+Inf/-Inf behavior for no-scale truncate - Normalize -0.0 to canonical +0.0 for deterministic output - Add regression coverage for signed-zero bit pattern and non-finite values
|
Split out the production truncate(value) fix into a dedicated PR: #17677. That PR includes the non-finite handling guard, allocation-free no-scale truncation path, signed-zero normalization, and expanded unit coverage. |
Keep apache#17652 focused on flaky-test fixes only; production truncate(value) fix is now tracked in apache#17677.
|
Updated this PR to remove all net pinot-core truncate changes; it now only contains flaky-test fixes in controller/integration tests. The production truncate(value) fix remains in dedicated PR #17677. Validation rerun:
|
Problem
Two flaky test failures were observed in CI:
PinotTableRestletResourceTest#testTableTasksCleanupWithNonActiveTasksFailed to delete job ... from queue ...during table deletion.TruncateDecimalTransformFunctionTest#testTruncateDecimalTransformFunctionexpected [0.0] but found [-0.0].Changes
1) Controller test race fix
testTableTasksCleanupWithNonActiveTasks, keep the minion task queue stopped while table deletion runs.finallyblock to avoid leaking queue state to other tests.2) Truncate signed-zero fix
TruncateDecimalTransformFunction, changed the single-argument path (truncate(value)) to use the same truncation logic astruncate(value, 0)viaBigDecimal.setScale(0, RoundingMode.DOWN).TruncateDecimalTransformFunctionTestfortruncate(-0.4)to guarantee canonical0.0output (not-0.0).Why this fixes flakiness
truncate(value)withtruncate(value, 0)semantics.Validation
./mvnw -pl pinot-controller -Dtest=PinotTableRestletResourceTest#testTableTasksCleanupWithNonActiveTasks -Dsurefire.failIfNoSpecifiedTests=false test -DskipITs -DskipIntegrationTests./mvnw -pl pinot-controller -Dtest=PinotTableRestletResourceTest#testTableTasksCleanupWithActiveTasks -Dsurefire.failIfNoSpecifiedTests=false test -DskipITs -DskipIntegrationTests./mvnw -pl pinot-controller -Dtest=PinotTableRestletResourceTest -Dsurefire.failIfNoSpecifiedTests=false test -DskipITs -DskipIntegrationTests./mvnw -pl pinot-core -Dtest=TruncateDecimalTransformFunctionTest -Dsurefire.failIfNoSpecifiedTests=false test -DskipITs -DskipIntegrationTestsTruncateDecimalTransformFunctionTest#testTruncateDecimalTransformFunction(5 consecutive successful iterations)