Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
state/presence: stop watchers/pingers before TearDownTest #5543
Conversation
|
$$fixes-1588574$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Generating tarball failed |
|
$$fixes-1588574$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
SHIT.
I think I know where this is coming from, I'll tackle it in the morning. |
|
$$fixes-1588574$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$fixes-1588574$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
davecheney commentedJun 6, 2016
•
Edited 1 time
-
ericsnowcurrently
Jun 6, 2016
Fixes LP 1588574
The
panic: session already closedcomes from a watcher or pinger thatis still running when the test case returns to TearDownTest. This
happens because while we always call w.Stop in a defer, w.Stop does not
actually stop the worker, it just asks it to stop.
To ensure the worker is stopped, introduce a new function
assertStoppedwhich stops a worker and waits until it reports stopped. This method should
be used in favor of defer w.Stop() because you must ensure that all workers
that share a mongo connection (which is all of them) have stopped, and thus
are no longer using a mgo session before
TearDownTestshuts down the connection.Because this pattern of stopping and not waiting was common to both the
pinter and watcher tests, and is now resolved, we can remove the
recoverin theping()method.(Review request: http://reviews.vapour.ws/r/4990/)