Skip to content

Fix Race in AsyncTwoPhaseIndexerTests.testStateMachine (#40947)#41013

Merged
original-brownbear merged 1 commit intoelastic:7.xfrom
original-brownbear:40947-7.x
Apr 9, 2019
Merged

Fix Race in AsyncTwoPhaseIndexerTests.testStateMachine (#40947)#41013
original-brownbear merged 1 commit intoelastic:7.xfrom
original-brownbear:40947-7.x

Conversation

@original-brownbear
Copy link
Copy Markdown
Contributor

  • The step is incremented by the listener in org.elasticsearch.xpack.core.indexing.AsyncTwoPhaseIndexerTests.MockIndexer#onFinish after isFinished is set to true, but the test only waited for isFinished,
    fixed by calling isFinished last
  • Also made step volatile since we are reading it from a different thread from the one incrementing it
  • Closes AsyncTwoPhaseIndexerTests testStateMachine CI failures #40946

backport of #40947

* The step is incremented by the listner in `org.elasticsearch.xpack.core.indexing.AsyncTwoPhaseIndexerTests.MockIndexer#onFinish` after isFinished is set to true, but the test only waited for `isFinished`,
fixed by calling `isFinished` last
* Also made `step` volatile since we are reading it from different thread from the one incrementing it
* Closes #40946
@original-brownbear original-brownbear added >test Issues or PRs that are addressing/adding tests :Analytics/Geo Indexing, search aggregations of geo points and shapes backport :ml/Transform Transform labels Apr 9, 2019
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytics-geo

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/ml-core

@original-brownbear original-brownbear merged commit e71db05 into elastic:7.x Apr 9, 2019
@original-brownbear original-brownbear deleted the 40947-7.x branch April 9, 2019 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Geo Indexing, search aggregations of geo points and shapes backport :ml/Transform Transform >test Issues or PRs that are addressing/adding tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants