-
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
[TEST] rename AsyncSearchActionTests to IT and move it out of unit tests #54520
[TEST] rename AsyncSearchActionTests to IT and move it out of unit tests #54520
Conversation
`AsyncSearchActionTests` currently fails quite often. That is since the introduction of `RestSubmitAsyncSearchActionTests` which indirectly manipulates the channels being tracked in `RestCancellableNodeClient`. There are channels left in the map after `RestSubmitAsyncSearchActionTests` is run, and later `AsyncSearchActionTests` checks that there are no channels in the map which makes each test method fail. This is particularily hard to reproduce as the order in which tests are run appears to be platform dependent. The test cluster assertion that there are no channels in the map only makes sense in the context of internal cluster tests, while there may be collisions with unit tests that register http channels as part of their testing. This can be solved by renaming `AsyncSearchActionTests` to `AsyncSearchActionIT`. This way it won't be run as part of unit tests but rather within another JVM where the number of channels is `0` and such assumption holds, because there are no expected manual manipulation of the channels. Relates to elastic#54180
Pinging @elastic/es-search (:Search/Search) |
Integer batchReduceSize = randomIntBetween(2, 50); | ||
doTestParameter("batched_reduce_size", Integer.toString(batchReduceSize), batchReduceSize, | ||
int batchedReduceSize = randomIntBetween(2, 50); | ||
doTestParameter("batched_reduce_size", Integer.toString(batchedReduceSize), batchedReduceSize, | ||
r -> r.getSearchRequest().getBatchedReduceSize()); |
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.
it would be cleaner to also clean up the channels being tracked due to the dispatchRequest calls from this test. I gave it a try though and it was not trivial, and the same should be done in RestCancellableNodeClientTests where we actually assume that we may have channels in the map already, hence we only check the delta since the test has started. I wonder if it's worth looking into cleaning the channels up after both tests have executed, or not.
run elasticsearch-ci/2 |
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.
LGTM
…sts (#54520) `AsyncSearchActionTests` currently fails quite often. That is since the introduction of `RestSubmitAsyncSearchActionTests` which indirectly manipulates the channels being tracked in `RestCancellableNodeClient`. There are channels left in the map after `RestSubmitAsyncSearchActionTests` is run, and later `AsyncSearchActionTests` checks that there are no channels in the map which makes each test method fail. This is particularily hard to reproduce as the order in which tests are run appears to be platform dependent. The test cluster assertion that there are no channels in the map only makes sense in the context of internal cluster tests, while there may be collisions with unit tests that register http channels as part of their testing. This can be solved by renaming `AsyncSearchActionTests` to `AsyncSearchActionIT`. This way it won't be run as part of unit tests but rather within another JVM where the number of channels is `0` and such assumption holds, because there are no expected manual manipulation of the channels. Relates to #54180
…sts (#54520) `AsyncSearchActionTests` currently fails quite often. That is since the introduction of `RestSubmitAsyncSearchActionTests` which indirectly manipulates the channels being tracked in `RestCancellableNodeClient`. There are channels left in the map after `RestSubmitAsyncSearchActionTests` is run, and later `AsyncSearchActionTests` checks that there are no channels in the map which makes each test method fail. This is particularily hard to reproduce as the order in which tests are run appears to be platform dependent. The test cluster assertion that there are no channels in the map only makes sense in the context of internal cluster tests, while there may be collisions with unit tests that register http channels as part of their testing. This can be solved by renaming `AsyncSearchActionTests` to `AsyncSearchActionIT`. This way it won't be run as part of unit tests but rather within another JVM where the number of channels is `0` and such assumption holds, because there are no expected manual manipulation of the channels. Relates to #54180
AsyncSearchActionTests
currently fails quite often. That is since the introduction ofRestSubmitAsyncSearchActionTests
which indirectly manipulates the channels being tracked inRestCancellableNodeClient
. There are channels left in the map afterRestSubmitAsyncSearchActionTests
is run, and laterAsyncSearchActionTests
checks that there are no channels in the map which makes each test method fail. This is particularily hard to reproduce as the order in which tests are run appears to be platform dependent.The test cluster assertion that there are no channels in the map only makes sense in the context of internal cluster tests, while there may be collisions with unit tests that register http channels as part of their testing.
This can be solved by renaming
AsyncSearchActionTests
toAsyncSearchActionIT
. This way it won't be run as part of unit tests but rather within another JVM where the number of channels is0
and such assumption holds, because there are no expected manual manipulation of the channels.Relates to #54180