mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 02:45:51 +02:00
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:
+2
-9
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user