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

Fixing rollup state tests after onFailure ordering change #45784

Merged
merged 2 commits into from
Aug 21, 2019

Conversation

benwtrent
Copy link
Member

After the PR #45676 onFailure is now called before the indexer state has transitioned out of indexing.

To fix these tests, I added a new check to make sure that we don't mark it as failed until AFTER doSaveState is called with a STARTED indexer.

Sorry for missing these test changes in the earlier PR.

closes #45770

@benwtrent benwtrent added >test Issues or PRs that are addressing/adding tests :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data v8.0.0 v7.4.0 labels Aug 21, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@benwtrent
Copy link
Member Author

I ran locally with this change 10k+ times and it never failed. Without this change I would get periodic failures (matching the closed issue).

@@ -946,10 +956,11 @@ protected void doNextBulk(BulkRequest request, ActionListener<BulkResponse> next
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
assertThat(indexer.getState(), equalTo(IndexerState.INDEXING));
latch.countDown();
assertBusy(() -> assertTrue(isFinished.get()));
ESTestCase.awaitBusy(() -> isFinished.get());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I think this awaitBusy can be removed. If the assertBusy above passes, this will always pass (unless there is some async condition that can change back to false). If the assertBusy fails if will fail the test and this line wont execute.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct! Let me fix it up really quick.

Copy link
Contributor

@polyfractal polyfractal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to the flow of state LGTM :)

@benwtrent benwtrent merged commit 1485549 into elastic:master Aug 21, 2019
@benwtrent benwtrent deleted the test/fix-RollupIndexerStateTests branch August 21, 2019 18:20
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Aug 21, 2019
)

After the PR elastic#45676 onFailure is now called before the indexer state has transitioned out of indexing.

To fix these tests, I added a new check to make sure that we don't mark it as failed until AFTER doSaveState is called with a STARTED indexer.
benwtrent added a commit that referenced this pull request Aug 21, 2019
…45814)

After the PR #45676 onFailure is now called before the indexer state has transitioned out of indexing.

To fix these tests, I added a new check to make sure that we don't mark it as failed until AFTER doSaveState is called with a STARTED indexer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data >test Issues or PRs that are addressing/adding tests v7.4.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] RollupIndexerStateTests expected STARTED
4 participants