diff --git a/test/e2e/chaosmonkey/chaosmonkey.go b/test/e2e/chaosmonkey/chaosmonkey.go index 97e37e3a03d..9acb5af46ed 100644 --- a/test/e2e/chaosmonkey/chaosmonkey.go +++ b/test/e2e/chaosmonkey/chaosmonkey.go @@ -98,14 +98,17 @@ func (cm *chaosmonkey) Do() { sem.waitForReadyOrDone() } + defer func() { + close(stopCh) + By("Waiting for async validations to complete") + for _, sem := range sems { + sem.waitForDone() + } + }() + By("Starting disruption") cm.disruption() By("Disruption complete; stopping async validations") - close(stopCh) - By("Waiting for async validations to complete") - for _, sem := range sems { - sem.waitForDone() - } } // Semaphore is taken by a Test and provides: Ready(), for the Test to call when it's ready for the