Skip to content

Commit

Permalink
Merge pull request #11979 from cevich/more_criu_fix
Browse files Browse the repository at this point in the history
Test-hang fix: Wait for ready + timeout on connect.
  • Loading branch information
openshift-merge-robot authored Oct 15, 2021
2 parents 307b1b4 + c1497cf commit a5c13bb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/e2e/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a5c13bb

Please sign in to comment.