Skip to content

Commit

Permalink
Merge pull request containers#13264 from mheon/fix_plugin_flake
Browse files Browse the repository at this point in the history
Fix a potential flake in volume plugins tests
  • Loading branch information
openshift-merge-robot authored Feb 17, 2022
2 parents a09e94f + 1252f9d commit 2702218
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/e2e/volume_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,21 @@ var _ = Describe("Podman volume plugins", func() {
create.WaitWithDefaultTimeout()
Expect(create).Should(Exit(0))

ctr1 := podmanTest.Podman([]string{"run", "--security-opt", "label=disable", "-v", fmt.Sprintf("%v:/test", volName), ALPINE, "sh", "-c", "touch /test/testfile && echo helloworld > /test/testfile"})
ctr1Name := "ctr1"
ctr1 := podmanTest.Podman([]string{"run", "--security-opt", "label=disable", "--name", ctr1Name, "-v", fmt.Sprintf("%v:/test", volName), ALPINE, "sh", "-c", "touch /test/testfile && echo helloworld > /test/testfile"})
ctr1.WaitWithDefaultTimeout()
Expect(ctr1).Should(Exit(0))

ctr2 := podmanTest.Podman([]string{"run", "--security-opt", "label=disable", "-v", fmt.Sprintf("%v:/test", volName), ALPINE, "cat", "/test/testfile"})
ctr2Name := "ctr2"
ctr2 := podmanTest.Podman([]string{"run", "--security-opt", "label=disable", "--name", ctr2Name, "-v", fmt.Sprintf("%v:/test", volName), ALPINE, "cat", "/test/testfile"})
ctr2.WaitWithDefaultTimeout()
Expect(ctr2).Should(Exit(0))
Expect(ctr2.OutputToString()).To(ContainSubstring("helloworld"))

// HACK: `volume rm -f` is timing out trying to remove containers using the volume.
// Solution: remove them manually...
// TODO: fix this when I get back
rmAll := podmanTest.Podman([]string{"rm", "-af"})
rmAll := podmanTest.Podman([]string{"rm", "-f", ctr2Name, ctr1Name})
rmAll.WaitWithDefaultTimeout()
Expect(rmAll).Should(Exit(0))
})
Expand Down

0 comments on commit 2702218

Please sign in to comment.