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

Fix testDataOnlyNodePersistence #56893

Conversation

DaveCTurner
Copy link
Contributor

This test failed if all 1000 top-level rarely() calls in the loop returned
false, because then we would never set the term of the persisted state. This
commit fixes this by adding an earlier call to persistedState#setCurrentTerm
and also randomises the number of iterations to catch other potential issues
like this. It also changes the test to clean up the threadpools it starts
whether it passes or fails.

Closes #56763

This test failed if all 1000 top-level `rarely()` calls in the loop returned
`false`, because then we would never set the term of the persisted state. This
commit fixes this by adding an earlier call to `persistedState#setCurrentTerm`
and also randomises the number of iterations to catch other potential issues
like this.  It also changes the test to clean up the threadpools it starts
whether it passes or fails.
@DaveCTurner DaveCTurner added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v8.0.0 v7.7.1 v7.8.1 v7.9.0 labels May 18, 2020
@DaveCTurner DaveCTurner requested a review from ywelsch May 18, 2020 11:19
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Cluster Coordination)

@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label May 18, 2020
@DaveCTurner
Copy link
Contributor Author

Review tip: if you ignore whitespace then this change is +11/−2 rather than +92/-83.

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@DaveCTurner DaveCTurner merged commit 703dad7 into elastic:master May 18, 2020
@DaveCTurner DaveCTurner deleted the 2020-05-18-fix-testDataOnlyNodePersistence branch May 18, 2020 12:54
DaveCTurner added a commit that referenced this pull request May 18, 2020
This test failed if all 1000 top-level `rarely()` calls in the loop returned
`false`, because then we would never set the term of the persisted state. This
commit fixes this by adding an earlier call to `persistedState#setCurrentTerm`.
It also changes the test to clean up the threadpools it starts whether it
passes or fails.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request May 18, 2020
PR elastic#56893 was supposed to randomise the iteration count in
`testDataOnlyNodePersistence` but this change was mistakenly omitted. This
commit addresses this.
DaveCTurner added a commit that referenced this pull request May 18, 2020
This test failed if all 1000 top-level `rarely()` calls in the loop returned
`false`, because then we would never set the term of the persisted state. This
commit fixes this by adding an earlier call to `persistedState#setCurrentTerm`.
It also changes the test to clean up the threadpools it starts whether it
passes or fails.
DaveCTurner added a commit that referenced this pull request May 18, 2020
PR #56893 was supposed to randomise the iteration count in
`testDataOnlyNodePersistence` but this change was mistakenly omitted. This
commit addresses this.
DaveCTurner added a commit that referenced this pull request May 18, 2020
PR #56893 was supposed to randomise the iteration count in
`testDataOnlyNodePersistence` but this change was mistakenly omitted. This
commit addresses this.
DaveCTurner added a commit that referenced this pull request May 18, 2020
PR #56893 was supposed to randomise the iteration count in
`testDataOnlyNodePersistence` but this change was mistakenly omitted. This
commit addresses this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. >test Issues or PRs that are addressing/adding tests v7.8.1 v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GatewayMetaStatePersistedStateTests#testDataOnlyNodePersistence fails occasionally
4 participants