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/terminationworker: fix test hang #5528
Conversation
davecheney
added some commits
Jun 3, 2016
|
$$fixes-1588135$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$fixes-1588135$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit bfa4702
into
juju:master
Jun 3, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
davecheney commentedJun 3, 2016
•
Edited 1 time
-
ericsnowcurrently
Jun 3, 2016
Fixes LP 1588135
Fix a race on the ownership of the abort signal.
The
TestSignaltest attempts to see if sendingSIGABRTto the testbinary itself will cause the worker to unblock itself and exit as
exited. However, as the original author discovered there is a race
between sending the signal and the worker spawned from
NewWorkerregistering a handler to catch
SIGABRT. If the handler was not registeredin time the
SIGABRTwould cause the test process to exit.To fix this problem they set up a
SIGABRThandler inSetUpTestto ensurethat
SIGABRTwas always handled. However this meant that ifNewWorker'shandler was not registered in time to catch the signal, it would be
delivered to the channel registered by
SetUpTest, causing the test binaryto hang.
The fix is to remove the
SetUpTestworkaround and ensure the handler isalways registered before spawning the loop goroutine so the caller is
assured that once
NewWorkerhas returned, the handler is in place and itis safe to send the signal.
This PR also removes unnecessary use of
testing.BaseSuite.(Review request: http://reviews.vapour.ws/r/4975/)