mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
stopping the ticker on exit
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user