DescriptionFix race condition in SSHStorage test
I found an intermittent failure in the synchronization
test for the SSHStorage. It only happened once, and not
again, but I felt it was worth fixing anyway.
The race was in the flock subprocess actually starting
before the following lines in the test. The lines following
expected the flock to be taken, but since the flock was
managed by an executed command, there is a race where it
may not have started.
I broke the synchronisation test into three as it was
really testing three distinct things.
The flock helper method now waits for the flock to be taken
by incrementally reading from stdout waiting for the initial
echo to be written out prior to the sleep.
The flock cleanup is also now handled by a cleanup method.
By breaking the test up, we no longer need to manually kill the
process as part of the test.
https://code.launchpad.net/~thumper/juju-core/fix-intermittent-failure/+merge/186690
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 1
MessagesTotal messages: 2
|