Deflake the daemon test (#532)

There's a race condition here where sometimes we get a layer and othertimes we don't.
This commit is contained in:
dlorenc
2019-01-17 15:30:08 -05:00
committed by GitHub
parent 503a972dbc
commit 6e7c91a1cb
2 changed files with 3 additions and 10 deletions
+2 -9
View File
@@ -18,7 +18,6 @@ package integration
import (
"bytes"
"fmt"
"os/exec"
"testing"
)
@@ -26,14 +25,8 @@ import (
// RunCommandWithoutTest will run cmd and if it fails will output relevant info
// for debugging before returning an error. It can be run outside the context of a test.
func RunCommandWithoutTest(cmd *exec.Cmd) ([]byte, error) {
var stderr bytes.Buffer
cmd.Stderr = &stderr
output, err := cmd.Output()
if err != nil {
fmt.Println(cmd.Args)
fmt.Println(stderr.String())
fmt.Println(string(output))
}
output, err := cmd.CombinedOutput()
return output, err
}
@@ -1,3 +1,3 @@
FROM busybox
RUN while true; do dd if=/dev/zero of=file`date +%s`.txt count=16000 bs=256 > /dev/null 2>&1; done &
RUN (while true; do sleep 10; dd if=/dev/zero of=file`date +%s`.txt count=16000 bs=256 > /dev/null 2>&1; done &); sleep 1
RUN echo "wait a second..." && sleep 2 && ls -lrat file*.txt || echo "test passed."