Fix flaky testExplainPlanQueryV2 by masking scientific-notation rule timings#18650
Open
yashmayya wants to merge 1 commit into
Open
Fix flaky testExplainPlanQueryV2 by masking scientific-notation rule timings#18650yashmayya wants to merge 1 commit into
yashmayya wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18650 +/- ##
============================================
- Coverage 64.45% 64.40% -0.05%
- Complexity 1282 1291 +9
============================================
Files 3352 3365 +13
Lines 207171 208066 +895
Branches 32348 32482 +134
============================================
+ Hits 133534 134007 +473
- Misses 62910 63283 +373
- Partials 10727 10776 +49
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
OfflineClusterIntegrationTest#testExplainPlanQueryV2is intermittently flaky. It compares the EXPLAIN output's "Rule Execution Times" section after masking each per-rule time with*, using the regexTime: \d+\.\d+.Rule timings are rendered as
durationNanos / 1_000_000.0(adouble) viaDouble.toString()inRuleTimingPlannerListener. When a rule runs fast enough (sub-microsecond, i.e.< 0.001ms),Double.toString()switches to scientific notation such as1.5E-4. The old regex matches only the1.5mantissa and leaves the exponent behind, producingTime:*E-4, which no longer matches the expectedTime:*:The rule list itself is correct/unchanged — only the time-masking is wrong. This is a pre-existing flake, unrelated to any Calcite version.
Fix
Extend the masking regex to also strip an optional scientific-notation exponent, so both
1.5and1.5E-4collapse to*:Applied to both occurrences in the test (the two responses asserted in the method).
Testing
./mvnw -pl pinot-integration-tests test -Dtest=OfflineClusterIntegrationTest#testExplainPlanQueryV2 -Dsurefire.failIfNoSpecifiedTests=falsepasses.