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

[BUG] org.opensearch.search.aggregations.metrics.MedianAbsoluteDeviationAggregatorTests.testQueryFiltering test failure #4789

Closed
kotwanikunal opened this issue Oct 13, 2022 · 11 comments
Assignees
Labels
bug Something isn't working distributed framework flaky-test Random test failure that succeeds on second run good first issue Good for newcomers hacktoberfest Global event that encourages people to contribute to open-source.

Comments

@kotwanikunal
Copy link
Member

Describe the bug
A test failure, possibly flakey - Noticed with #4786

To Reproduce

REPRODUCE WITH: ./gradlew ':server:test' --tests "org.opensearch.search.aggregations.metrics.MedianAbsoluteDeviationAggregatorTests.testQueryFiltering" -Dtests.seed=31AC51DE66176DE -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=nl-BE -Dtests.timezone=America/Boa_Vista -Druntime.java=17

Expected behavior

  • Test should pass.

Plugins

  • None

Screenshots

org.opensearch.search.aggregations.metrics.MedianAbsoluteDeviationAggregatorTests > testQueryFiltering FAILED
    java.lang.AssertionError: 
    Expected: within <10.0> percent of <125.0>
         but: was <111.1025641025641>
        at __randomizedtesting.SeedInfo.seed([31AC51DE66176DE:C77329D1892D88C7]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
        at org.junit.Assert.assertThat(Assert.java:964)
        at org.junit.Assert.assertThat(Assert.java:930)
        at org.opensearch.search.aggregations.metrics.MedianAbsoluteDeviationAggregatorTests.lambda$testQueryFiltering$11(MedianAbsoluteDeviationAggregatorTests.java:154)
        at org.opensearch.search.aggregations.AggregatorTestCase.testCase(AggregatorTestCase.java:619)
        at org.opensearch.search.aggregations.metrics.MedianAbsoluteDeviationAggregatorTests.testAggregation(MedianAbsoluteDeviationAggregatorTests.java:255)
        at org.opensearch.search.aggregations.metrics.MedianAbsoluteDeviationAggregatorTests.testAggregation(MedianAbsoluteDeviationAggregatorTests.java:245)
        at org.opensearch.search.aggregations.metrics.MedianAbsoluteDeviationAggregatorTests.testQueryFiltering(MedianAbsoluteDeviationAggregatorTests.java:149)

Host/Environment (please complete the following information):

  • Jenkins build/check environment

Additional context
N/A

@kotwanikunal kotwanikunal added bug Something isn't working untriaged flaky-test Random test failure that succeeds on second run labels Oct 13, 2022
@andrross
Copy link
Member

A quick investigation suggests that when this random call generates a value less than 21 for the random double, then the test will fail.

@andrross andrross added hacktoberfest Global event that encourages people to contribute to open-source. good first issue Good for newcomers labels Oct 13, 2022
@SohamRatnaparkhi
Copy link

Hey @andrross, I would like to work on this issue. Can you assign it to me?

@andrross
Copy link
Member

Hey @andrross, I would like to work on this issue. Can you assign it to me?

Done! Thanks for looking into this!

@SohamRatnaparkhi
Copy link

Can anyone guide me in short as to what I have to do to solve this issue?
Basically, how can I start; where are the required files wherein I have to make changes.

@andrross
Copy link
Member

@SohamRatnaparkhi So changing the 20 to a 21 in this test case would likely fix the test failure, but it would be better (and is much harder :) ) to answer the question of why a value below 21 causes the test to fail. It could be that the original test author just miscalculated a bit, or it could be a bug. Answering this question requires digging into exactly what the test is intending to do.

@SohamRatnaparkhi
Copy link

Okay, I will try and find out the reason too along with changing 20 to a 21.

@SohamRatnaparkhi
Copy link

Hi, tried searching in the code base as to why code breaks at value = 20. Anyways, So I am making a PR by changing 20 to 21.

@austintlee
Copy link
Contributor

I can get it to fail with 21 and 22. Any progress on this? Can I take this on?

@austintlee
Copy link
Contributor

@andrross @SohamRatnaparkhi can you assign this one to me?

@andrross
Copy link
Member

@austintlee For some reason GitHub does not allow me to add you in the assignee field, but please feel free to take this on. Thanks!

@dblock
Copy link
Member

dblock commented Apr 28, 2023

Closed via #7317

@dblock dblock closed this as completed Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working distributed framework flaky-test Random test failure that succeeds on second run good first issue Good for newcomers hacktoberfest Global event that encourages people to contribute to open-source.
Projects
None yet
Development

No branches or pull requests

6 participants