From cf772ee4bc842e51404cd75caec992dc7e33d02f Mon Sep 17 00:00:00 2001 From: Federico Gimenez Date: Thu, 3 Sep 2015 13:23:19 +0200 Subject: [PATCH] stopping the ticker on exit --- _integration-tests/testutils/wait/wait.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_integration-tests/testutils/wait/wait.go b/_integration-tests/testutils/wait/wait.go index d706612893..7f221c87a1 100644 --- a/_integration-tests/testutils/wait/wait.go +++ b/_integration-tests/testutils/wait/wait.go @@ -66,10 +66,12 @@ func forCommand(c *check.C, outputPattern string, cmds ...string) (err error) { case <-tickChan: output = execCommand(c, cmds...) if match := re.FindString(output); match != "" { + ticker.Stop() return } retries++ if retries >= MaxWaitRetries { + ticker.Stop() return fmt.Errorf("Pattern not found in command output") } }