Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
worker/machiner: ensure api errors set before worker starts. #6397
Conversation
QAUnit tests pass in worker/machiner |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit 678647b
into
juju:master
Oct 7, 2016
howbazaar
deleted the
howbazaar:fix-machiner-race
branch
Oct 7, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
howbazaar commentedOct 6, 2016
•
Edited 1 time
-
howbazaar
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