summaryrefslogtreecommitdiff
path: root/test/e2e/run_signal_test.go
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-02-05 14:08:01 -0700
committerEd Santiago <santiago@redhat.com>2019-02-05 14:10:49 -0700
commit7ee8fe86c162331630c7d1e16a28f68b7f8ac143 (patch)
treecb100198f09a1c45db64b00a16c461da50a08d7c /test/e2e/run_signal_test.go
parent650e242aa90fcb3f161da6e97921c606d3083215 (diff)
downloadpodman-7ee8fe86c162331630c7d1e16a28f68b7f8ac143.tar.gz
podman-7ee8fe86c162331630c7d1e16a28f68b7f8ac143.tar.bz2
podman-7ee8fe86c162331630c7d1e16a28f68b7f8ac143.zip
e2e tests: sigproxy: fix rare hang condition
The sig-proxy test creates a FIFO, runs podman with actions that write to it, then tries reading from the FIFO. Opening a FIFO for read or write blocks until the other end is opened for the corresponding write/read. If our podman process fails for any reason, the test's FIFO open will hang forever. Solution: open with O_NONBLOCK. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/e2e/run_signal_test.go')
-rw-r--r--test/e2e/run_signal_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/e2e/run_signal_test.go b/test/e2e/run_signal_test.go
index 9be8e7810..51c14602e 100644
--- a/test/e2e/run_signal_test.go
+++ b/test/e2e/run_signal_test.go
@@ -55,7 +55,7 @@ var _ = Describe("Podman run with --sig-proxy", func() {
_, pid := podmanTest.PodmanPID([]string{"run", "-it", "-v", fmt.Sprintf("%s:/h:Z", udsDir), fedoraMinimal, "bash", "-c", sigCatch})
- uds, _ := os.OpenFile(udsPath, os.O_RDONLY, 0600)
+ uds, _ := os.OpenFile(udsPath, os.O_RDONLY|syscall.O_NONBLOCK, 0600)
defer uds.Close()
// Wait for the script in the container to alert us that it is READY
@@ -73,7 +73,7 @@ var _ = Describe("Podman run with --sig-proxy", func() {
}
time.Sleep(1 * time.Second)
if counter == 15 {
- os.Exit(1)
+ Fail("Timed out waiting for READY from container")
}
counter++
}
@@ -99,7 +99,7 @@ var _ = Describe("Podman run with --sig-proxy", func() {
}
time.Sleep(1 * time.Second)
if counter == 15 {
- os.Exit(1)
+ Fail("timed out waiting for FOO from container")
}
counter++
}