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 the intermittent failure of TestRemovePrimaryValidSecondaries #10581

Merged
merged 1 commit into from Sep 2, 2019

Conversation

howbazaar
Copy link
Contributor

There were two different causes of the intermittent failure. Both had to do with the expectations of the worker main loop, and things actually happening differently.

Given that all the inputs to the worker were controlled, we should be able to be deterministic.

The first failure case was when passing through the loop we had a success then a failure to write. This would give two waiters. However if we had failure followed by success, there would be only one waiter. This was fixed by the change in logic that says if there was a pevious failure when we get a success, update the wait time to be the poll interval.

The second failure case was during the initialize function call where the call would return before the time.After channel had been signalled. There was the assumption that init wasn't complete until there had been a poll happen, but it was possible to have this return before the updateChan was signalled. This caused the rest of the test to progress before things were ready.

QA steps

  • stress-race the test for ages

Bug reference

https://bugs.launchpad.net/juju/+bug/1802590

@@ -303,7 +310,11 @@ func (w *pgWorker) loop() error {
// Update the replica set members occasionally to keep them up to
// date with the current replica-set member statuses.
logger.Tracef("succeeded, waking up after: %v", pollInterval)
if updateChan == nil {
// If we had previously failed to update to update the replicaset,
Copy link
Contributor

Choose a reason for hiding this comment

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

only need one 'to update'

@howbazaar
Copy link
Contributor Author

$$merge$$

@jujubot jujubot merged commit 8b5244d into juju:develop Sep 2, 2019
@howbazaar howbazaar deleted the peer-grouper-test-fix branch September 2, 2019 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants