-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix a flaky test #11771
Fix a flaky test #11771
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.
Good catch!
Set<Integer> expectedResult = new LinkedHashSet(); | ||
expectedResult.addAll(Arrays.asList(0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 19, 20, 25, 27, 29)); |
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.
Set<Integer> expectedResult = new LinkedHashSet(); | |
expectedResult.addAll(Arrays.asList(0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 19, 20, 25, 27, 29)); | |
List<Integer> expectedResult = Arrays.asList(0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 19, 20, 25, 27, 29); |
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.
Thanks for the prompt reply! I have changed the patch based on the suggestion.
Please fix the import |
Codecov Report
@@ Coverage Diff @@
## master #11771 +/- ##
============================================
- Coverage 63.13% 62.98% -0.16%
Complexity 1117 1117
============================================
Files 2342 2342
Lines 125916 125996 +80
Branches 19370 19378 +8
============================================
- Hits 79501 79362 -139
- Misses 40749 40968 +219
Partials 5666 5666
Flags with carried forward coverage won't be shown. Click here to find out more. see 24 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This PR is to fix a flaky test
org.apache.pinot.core.operator.filter.NotFilterOperatorTest#testNotOperator
in modulepinot-core
.Test failures
Root cause and fix
In line 38,
expectedResult
is defined as aHashSet
, which does not guarantee the orders of its elements, so in line 46, when iterating the elements of aHashSet
, the elements returned are not in a consistent order, which leads to test failures. To fix the flakiness, useLinkedHashSet
instead ofHashSet
.