1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Reduce TestRunCommandWithTimeoutKilled flakiness

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2016-10-10 17:31:15 -07:00
parent 4331b6271a
commit 797f630d2e

View file

@ -63,12 +63,12 @@ func TestRunCommandWithTimeoutKilled(t *testing.T) {
t.Skip("Needs porting to Windows")
}
command := []string{"sh", "-c", "while true ; do echo 1 ; sleep .1 ; done"}
result := RunCmd(Cmd{Command: command, Timeout: 500 * time.Millisecond})
command := []string{"sh", "-c", "while true ; do echo 1 ; sleep .5 ; done"}
result := RunCmd(Cmd{Command: command, Timeout: 1250 * time.Millisecond})
result.Assert(t, Expected{Timeout: true})
ones := strings.Split(result.Stdout(), "\n")
assert.Equal(t, len(ones), 6)
assert.Equal(t, len(ones), 4)
}
func TestRunCommandWithErrors(t *testing.T) {