Skip to content
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

Conversation

@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2023

Codecov Report

Merging #11848 (e212e07) into master (ecac6c9) will increase coverage by 0.05%.
The diff coverage is n/a.

@@             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     
Flag Coverage Δ
custom-integration1 <0.01% <ø> (ø)
integration <0.01% <ø> (ø)
integration1 <0.01% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 62.86% <ø> (+0.03%) ⬆️
java-21 62.78% <ø> (+0.04%) ⬆️
skip-bytebuffers-false 62.91% <ø> (+0.07%) ⬆️
skip-bytebuffers-true 62.75% <ø> (+0.01%) ⬆️
temurin 62.92% <ø> (+0.05%) ⬆️
unittests 62.92% <ø> (+0.05%) ⬆️
unittests1 66.91% <ø> (+0.03%) ⬆️
unittests2 14.46% <ø> (+0.02%) ⬆️

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])));
Copy link
Contributor

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

Copy link
Contributor Author

@xiangfu0 xiangfu0 Oct 23, 2023

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.

cc: @walterddr @Jackie-Jiang

@xiangfu0 xiangfu0 merged commit 7051e46 into apache:master Oct 23, 2023
19 checks passed
@xiangfu0 xiangfu0 deleted the flaky-test-TupleSelectionTransformFunctionsTest branch October 23, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants