-
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
fixing flaky tests in TupleSelectionTransformFunctionsTest #11848
fixing flaky tests in TupleSelectionTransformFunctionsTest #11848
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11848 +/- ##
============================================
+ Coverage 62.87% 62.92% +0.05%
+ Complexity 1141 1140 -1
============================================
Files 2367 2367
Lines 127888 127888
Branches 19732 19732
============================================
+ Hits 80410 80474 +64
+ Misses 41754 41683 -71
- Partials 5724 5731 +7
Flags with carried forward coverage won't be shown. Click here to find out more. see 13 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -323,7 +323,7 @@ public void testGreatestTransformFunctionIntFloat() { | |||
assertEquals(transformFunction.getResultMetadata().getDataType(), FieldSpec.DataType.DOUBLE); | |||
double[] doubleValues = transformFunction.transformToDoubleValuesSV(_projectionBlock); | |||
for (int i = 0; i < NUM_ROWS; i++) { | |||
assertEquals(doubleValues[i], Math.max(Math.max(_intSVValues[i], -1), _doubleSVValues[i])); | |||
assertEquals(doubleValues[i], Math.max(Math.max(_intSVValues[i], -1), Double.valueOf(_floatSVValues[i]))); |
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.
how was this ever correct? doubleSVValue and floatSVValues are not even the same column
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.
This is due to how we generate the float and double values,
_intSVValues[i] = RANDOM.nextInt();
_longSVValues[i] = RANDOM.nextLong();
_floatSVValues[i] = _intSVValues[i] * RANDOM.nextFloat();
_doubleSVValues[i] = _intSVValues[i] * RANDOM.nextDouble();
So max(_intSVValues[i], -1, _floatSVValues[i])
should be:
int
if int >= 0
when int<0
, since the absolute value of this int column could be very large, the only possibility is that the random double is very small, which makes the double value fall into the range of [-1 ,0], then the value would be double value, instead of -1, then trigger the flaky.
Fix for https://github.com/apache/pinot/actions/runs/6598363647/job/17926275514
https://pipelinesghubeus21.actions.githubusercontent.com/Jmn7OQXHo9UaeQG1T0mAKKNYVbzrNsJhxqR9c70rTy53Xaqjrg/_apis/pipelines/1/runs/46018/signedlogcontent/5?urlExpires=2023-10-21T22%3A41%3A11.2565070Z&urlSigningMethod=HMACV1&urlSignature=HtnWhkIQuLyJAyKDOm5HMmGGkEuAGy8yJ6OUXclxttU%3D