-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[Tests] AbstractBuilderTestCase reproducibility is broken #32400
Labels
:Search/Search
Search-related issues that do not fall into other categories
>test
Issues or PRs that are addressing/adding tests
v7.0.0-beta1
Comments
cbuescher
added
>test
Issues or PRs that are addressing/adding tests
:Search/Search
Search-related issues that do not fall into other categories
labels
Jul 26, 2018
Pinging @elastic/es-search-aggs |
cbuescher
pushed a commit
to cbuescher/elasticsearch
that referenced
this issue
Jul 26, 2018
Currently AbstractBuilderTestCase generates certain random values in its `beforeTest()` method annotated with @before only the first time that a test method in the suite is run. This changes the values of subsequent random values and has the effect that when running single methods from a test suite with "-Dtests.method=*", the random values it sees are different from when the same test method is run as part of the whole test suite. This makes it harder to use the reproduction lines logged on failure. This changes the above method so that `beforeTest` will do the same call to the random value source each time a test method is run, so reproduction by running just one method is possible again. Closes elastic#32400
cbuescher
pushed a commit
that referenced
this issue
Aug 10, 2018
Currently AbstractBuilderTestCase generates certain random values in its `beforeTest()` method annotated with @before only the first time that a test method in the suite is run while initializing the serviceHolder that we use for the rest of the test. This changes the values of subsequent random values and has the effect that when running single methods from a test suite with "-Dtests.method=*", the random values it sees are different from when the same test method is run as part of the whole test suite. This makes it hard to use the reproduction lines logged on failure. This change runs the inialization of the serviceHolder and the randomization connected to it using the test runners master seed, so reproduction by running just one method is possible again. Closes #32400
cbuescher
pushed a commit
that referenced
this issue
Aug 10, 2018
Currently AbstractBuilderTestCase generates certain random values in its `beforeTest()` method annotated with @before only the first time that a test method in the suite is run while initializing the serviceHolder that we use for the rest of the test. This changes the values of subsequent random values and has the effect that when running single methods from a test suite with "-Dtests.method=*", the random values it sees are different from when the same test method is run as part of the whole test suite. This makes it hard to use the reproduction lines logged on failure. This change runs the inialization of the serviceHolder and the randomization connected to it using the test runners master seed, so reproduction by running just one method is possible again. Closes #32400
cbuescher
pushed a commit
that referenced
this issue
Aug 10, 2018
Currently AbstractBuilderTestCase generates certain random values in its `beforeTest()` method annotated with @before only the first time that a test method in the suite is run while initializing the serviceHolder that we use for the rest of the test. This changes the values of subsequent random values and has the effect that when running single methods from a test suite with "-Dtests.method=*", the random values it sees are different from when the same test method is run as part of the whole test suite. This makes it hard to use the reproduction lines logged on failure. This change runs the inialization of the serviceHolder and the randomization connected to it using the test runners master seed, so reproduction by running just one method is possible again. Closes #32400
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Search/Search
Search-related issues that do not fall into other categories
>test
Issues or PRs that are addressing/adding tests
v7.0.0-beta1
Rest extending AbstractBuilderTestCase (essential all Query- and AggregationBuilder unit test) are not reproducible with the info that we log on test failure. The random values generated in each test method change depending on whether the method is run separately (e.g. with -Dtest.method) or the whole test suite is run. This happens even when fixing the full seed and not just the master seed.
To demonstrate this, add the following test method to e.g. RangeQueryBuilderTests:
The whole test suite passes with
97B45898EB8C54FC
as the master seed:However, only running with
-Dtests.method="testRandomness"
, this fails with a different random long value than expected:Using the full seed as reported above when running the full suite works, so this passes:
But fails when using the REPRODUCE log line that includes the "-Dtests.method" parameter:
The text was updated successfully, but these errors were encountered: