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

[CI] SearchReplicaSelectionIT.testNodeSelection #70621

Closed
henningandersen opened this issue Mar 22, 2021 · 6 comments · Fixed by #71507
Closed

[CI] SearchReplicaSelectionIT.testNodeSelection #70621

henningandersen opened this issue Mar 22, 2021 · 6 comments · Fixed by #71507
Assignees
Labels
:Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team >test-failure Triaged test failures from CI

Comments

@henningandersen
Copy link
Contributor

henningandersen commented Mar 22, 2021

This happened locally, but I can see it failing in CI too.

Build scan:
https://gradle-enterprise.elastic.co/s/ewsio3cffibpa

Repro line:

./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.search.routing.SearchReplicaSelectionIT.testNodeSelection" -Dtests.seed=B189466086BCB35A -Dtests.security.manager=true -Dtests.locale=es-AR -Dtests.timezone=America/Whitehorse -Druntime.java=13

Reproduces locally?:
Happened locally, but repro line did not reproduce locally.

Applicable branches:
master (though likely also 7.x)

Failure history:
Has failed a few times per day since it was introduced in #70283.

Failure excerpt:

org.junit.ComparisonFailure: expected:<[oM8ifFUsRkG4AYoXVpxG8]g> but was:<[q6ccPdpJTyScxAYaTv88H]g>
        at __randomizedtesting.SeedInfo.seed([B189466086BCB35A:D85D541A5EDDFA1E]:0)
        at org.junit.Assert.assertEquals(Assert.java:115)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at org.elasticsearch.search.routing.SearchReplicaSelectionIT.testNodeSelection(SearchReplicaSelectionIT.java:99)
@henningandersen henningandersen added :Search/Search Search-related issues that do not fall into other categories >test-failure Triaged test failures from CI labels Mar 22, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Mar 22, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@henningandersen
Copy link
Contributor Author

Muted in #70622

@henningandersen
Copy link
Contributor Author

Got another failure on this doing ./gradlew check, looks like it is affected by concurrent activity (or prior tests).

@tlrx
Copy link
Member

tlrx commented Mar 23, 2021

In case it helps to investigate the failure, here is another build scan (https://gradle-enterprise.elastic.co/s/3jolsfrjatrie) for a failure that occurred before the test was muted.

@jimczi
Copy link
Contributor

jimczi commented Mar 23, 2021

The problem is related to the fact that some nodes are mocked with a search service that doesn't handle ARS:

return new MockSearchService(clusterService, indicesService, threadPool, scriptService,

It's easy to change but I wonder if this IT can be trusted. Any query in the background can change the score of the nodes and make the test fail. It's unclear to me how clusters are reused in IT tests but the assumptions only hold in isolation.

@jtibshirani
Copy link
Contributor

jtibshirani commented Apr 8, 2021

@jimczi thank you for debugging it. I opened a PR with this fix: #71507. I ran the test a bunch of times with the fix and didn't see failures.

I looked into ESIntegTestCase and confirmed that we do not share clusters between tests. However there is a concern around extra searches that affect ARS behavior: it's theoretically possible we could search a system index on start-up or in the background.

My suggestion is to fix and reenable the test, but if observe more flakiness we can consider removing it. I find the test valuable -- debugging the test actually surfaced another ARS bug (which I'll file soon)! But it doesn't add huge value beyond the existing unit tests, and we should avoid spending a lot of effort fixing a fragile test.

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 Team:Search Meta label for search team >test-failure Triaged test failures from CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants