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

worker/machiner: ensure api errors set before worker starts. #6397

Merged
merged 1 commit into from Oct 7, 2016

Conversation

howbazaar
Copy link
Contributor

@howbazaar howbazaar commented Oct 6, 2016

It seems blindingly obvious once it is pointed out, the error returns from the mock API need to be set before the worker that uses that API is started.

There is a race between the worker starting the goroutine that calls the setup and handler methods of the machiner, and the test setting the API error return values. In almost all circumstances, the test wins the race, but sometimes the worker goroutine calls an API before the error returns are set. The default behaviour of the mock NextErr() method is to return nil if none have been set. This means that the final error that is set by the test is never returned.

Fixes http://pad.lv/1612744

@howbazaar
Copy link
Contributor Author

QA

Unit tests pass in worker/machiner

@howbazaar
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Oct 6, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 678647b into juju:master Oct 7, 2016
@howbazaar howbazaar deleted the fix-machiner-race branch October 7, 2016 00:40
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