Merge pull request #21661 from edsantiago/stopsignal

More test tweaks to avoid "StopSignal ... 10 seconds" warning
This commit is contained in:
openshift-merge-bot[bot]
2024-02-15 13:56:02 +00:00
committed by GitHub
7 changed files with 13 additions and 12 deletions

View File

@ -87,7 +87,7 @@ var _ = Describe("Podman events", func() {
It("podman events with a type", func() { It("podman events with a type", func() {
setup := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:foobarpod", ALPINE, "top"}) setup := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:foobarpod", ALPINE, "top"})
setup.WaitWithDefaultTimeout() setup.WaitWithDefaultTimeout()
stop := podmanTest.Podman([]string{"pod", "stop", "foobarpod"}) stop := podmanTest.Podman([]string{"pod", "stop", "-t0", "foobarpod"})
stop.WaitWithDefaultTimeout() stop.WaitWithDefaultTimeout()
Expect(stop).Should(ExitCleanly()) Expect(stop).Should(ExitCleanly())
Expect(setup).Should(ExitCleanly()) Expect(setup).Should(ExitCleanly())

View File

@ -405,7 +405,8 @@ var _ = Describe("Podman prune", func() {
session = podmanTest.Podman([]string{"pod", "stop", podid1}) session = podmanTest.Podman([]string{"pod", "stop", podid1})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly()) // FIXME - #20196: Cannot use ExitCleanly()
Expect(session).Should(Exit(0))
// Create a container. This container should be pruned. // Create a container. This container should be pruned.
create := podmanTest.Podman([]string{"create", "--name", "test", BB}) create := podmanTest.Podman([]string{"create", "--name", "test", BB})

View File

@ -248,7 +248,8 @@ var _ = Describe("Podman restart", func() {
result := podmanTest.Podman([]string{"restart", "--cidfile", tmpFile}) result := podmanTest.Podman([]string{"restart", "--cidfile", tmpFile})
result.WaitWithDefaultTimeout() result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly()) // FIXME - #20196: Cannot use ExitCleanly()
Expect(result).Should(Exit(0))
output := result.OutputToString() output := result.OutputToString()
Expect(output).To(ContainSubstring(cid)) Expect(output).To(ContainSubstring(cid))
}) })

View File

@ -329,7 +329,7 @@ var _ = Describe("Podman rm", func() {
Expect(ctr2).Should(ExitCleanly()) Expect(ctr2).Should(ExitCleanly())
cid2 := ctr2.OutputToString() cid2 := ctr2.OutputToString()
rm := podmanTest.Podman([]string{"rm", "-fa"}) rm := podmanTest.Podman([]string{"rm", "-t0", "-fa"})
rm.WaitWithDefaultTimeout() rm.WaitWithDefaultTimeout()
Expect(rm).Should(ExitCleanly()) Expect(rm).Should(ExitCleanly())
Expect(rm.ErrorToString()).To(BeEmpty(), "rm -fa error logged") Expect(rm.ErrorToString()).To(BeEmpty(), "rm -fa error logged")

View File

@ -1541,7 +1541,7 @@ VOLUME %s`, ALPINE, volPath, volPath)
ctr.WaitWithDefaultTimeout() ctr.WaitWithDefaultTimeout()
Expect(ctr).Should(ExitCleanly()) Expect(ctr).Should(ExitCleanly())
stop := podmanTest.Podman([]string{"stop", ctrName}) stop := podmanTest.Podman([]string{"stop", "-t0", ctrName})
stop.WaitWithDefaultTimeout() stop.WaitWithDefaultTimeout()
Expect(stop).Should(ExitCleanly()) Expect(stop).Should(ExitCleanly())
@ -1693,13 +1693,15 @@ VOLUME %s`, ALPINE, volPath, volPath)
session := podmanTest.Podman([]string{"create", "--replace", ALPINE, "/bin/sh"}) session := podmanTest.Podman([]string{"create", "--replace", ALPINE, "/bin/sh"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(125)) Expect(session).Should(Exit(125))
Expect(session.ErrorToString()).To(ContainSubstring("cannot replace container without --name being set"))
// Run and replace 5 times in a row the "same" container. // Run and replace 5 times in a row the "same" container.
ctrName := "testCtr" ctrName := "testCtr"
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
session := podmanTest.Podman([]string{"run", "--detach", "--replace", "--name", ctrName, ALPINE, "top"}) session := podmanTest.Podman([]string{"run", "--detach", "--replace", "--name", ctrName, ALPINE, "top"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly()) // FIXME - #20196: Cannot use ExitCleanly()
Expect(session).Should(Exit(0))
// make sure Podman prints only one ID // make sure Podman prints only one ID
Expect(session.OutputToString()).To(HaveLen(64)) Expect(session.OutputToString()).To(HaveLen(64))

View File

@ -77,16 +77,13 @@ load helpers
# stop -a must print the IDs # stop -a must print the IDs
run_podman run -d $IMAGE top run_podman run -d $IMAGE top
ctrID="$output" ctrID="$output"
# Output means container has set up its signal handlers run_podman stop -t0 --all
wait_for_output "Mem:" $ctrID
run_podman stop --all
is "$output" "$ctrID" is "$output" "$ctrID"
# stop $input must print $input # stop $input must print $input
cname=$(random_string) cname=$(random_string)
run_podman run -d --name $cname $IMAGE top run_podman run -d --name $cname $IMAGE top
wait_for_output "Mem:" $cname run_podman stop -t0 $cname
run_podman stop $cname
is "$output" $cname is "$output" $cname
run_podman rm -t 0 -f $ctrID $cname run_podman rm -t 0 -f $ctrID $cname

View File

@ -155,7 +155,7 @@ Labels.l | $mylabel
cid=$output cid=$output
run_podman 2 volume rm myvol run_podman 2 volume rm myvol
is "$output" "Error: volume myvol is being used by the following container(s): $cid: volume is being used" "should error since container is running" is "$output" "Error: volume myvol is being used by the following container(s): $cid: volume is being used" "should error since container is running"
run_podman volume rm myvol --force run_podman volume rm myvol --force -t0
} }
# Running scripts (executables) from a volume # Running scripts (executables) from a volume