Defer test stop & cleanup
This commit is contained in:
parent
8e07e61a43
commit
f40f45abc1
@ -98,14 +98,17 @@ func (cm *chaosmonkey) Do() {
|
|||||||
sem.waitForReadyOrDone()
|
sem.waitForReadyOrDone()
|
||||||
}
|
}
|
||||||
|
|
||||||
By("Starting disruption")
|
defer func() {
|
||||||
cm.disruption()
|
|
||||||
By("Disruption complete; stopping async validations")
|
|
||||||
close(stopCh)
|
close(stopCh)
|
||||||
By("Waiting for async validations to complete")
|
By("Waiting for async validations to complete")
|
||||||
for _, sem := range sems {
|
for _, sem := range sems {
|
||||||
sem.waitForDone()
|
sem.waitForDone()
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
By("Starting disruption")
|
||||||
|
cm.disruption()
|
||||||
|
By("Disruption complete; stopping async validations")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Semaphore is taken by a Test and provides: Ready(), for the Test to call when it's ready for the
|
// Semaphore is taken by a Test and provides: Ready(), for the Test to call when it's ready for the
|
||||||
|
Loading…
Reference in New Issue
Block a user