diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-10-15 15:26:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-15 15:26:46 +0200 |
commit | a5c13bb8f7001f37b91d187163fd25913dc9d5a4 (patch) | |
tree | 04471ee26597879f544763fcc1fc654355f84c9f /test | |
parent | 307b1b43b2dc7933e0e60a054026dd6d01148afd (diff) | |
parent | c1497cf44f466d3093c8ab29e7c0c48ad3c2f9e4 (diff) | |
download | podman-a5c13bb8f7001f37b91d187163fd25913dc9d5a4.tar.gz podman-a5c13bb8f7001f37b91d187163fd25913dc9d5a4.tar.bz2 podman-a5c13bb8f7001f37b91d187163fd25913dc9d5a4.zip |
Merge pull request #11979 from cevich/more_criu_fix
Test-hang fix: Wait for ready + timeout on connect.
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/checkpoint_test.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index 73ca5e1a6..db8029878 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -6,6 +6,7 @@ import ( "os" "os/exec" "strings" + "time" "github.com/containers/podman/v3/pkg/checkpoint/crutils" "github.com/containers/podman/v3/pkg/criu" @@ -247,16 +248,19 @@ var _ = Describe("Podman checkpoint", func() { session := podmanTest.Podman(localRunString) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) + cid := session.OutputToString() + if !WaitContainerReady(podmanTest, cid, "Ready to accept connections", 20, 1) { + Fail("Container failed to get ready") + } IP := podmanTest.Podman([]string{"inspect", "-l", "--format={{.NetworkSettings.IPAddress}}"}) IP.WaitWithDefaultTimeout() Expect(IP).Should(Exit(0)) // Open a network connection to the redis server - conn, err := net.Dial("tcp", IP.OutputToString()+":6379") - if err != nil { - os.Exit(1) - } + conn, err := net.DialTimeout("tcp4", IP.OutputToString()+":6379", time.Duration(3)*time.Second) + Expect(err).To(BeNil()) + // This should fail as the container has established TCP connections result := podmanTest.Podman([]string{"container", "checkpoint", "-l"}) result.WaitWithDefaultTimeout() |