Skip to content

Commit

Permalink
Merge pull request #21661 from edsantiago/stopsignal
Browse files Browse the repository at this point in the history
More test tweaks to avoid "StopSignal ... 10 seconds" warning
  • Loading branch information
openshift-merge-bot[bot] authored Feb 15, 2024
2 parents 13d1e8b + e5f86f8 commit bbd4476
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion test/e2e/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var _ = Describe("Podman events", func() {
It("podman events with a type", func() {
setup := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:foobarpod", ALPINE, "top"})
setup.WaitWithDefaultTimeout()
stop := podmanTest.Podman([]string{"pod", "stop", "foobarpod"})
stop := podmanTest.Podman([]string{"pod", "stop", "-t0", "foobarpod"})
stop.WaitWithDefaultTimeout()
Expect(stop).Should(ExitCleanly())
Expect(setup).Should(ExitCleanly())
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/prune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ var _ = Describe("Podman prune", func() {

session = podmanTest.Podman([]string{"pod", "stop", podid1})
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 := podmanTest.Podman([]string{"create", "--name", "test", BB})
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ var _ = Describe("Podman restart", func() {

result := podmanTest.Podman([]string{"restart", "--cidfile", tmpFile})
result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly())
// FIXME - #20196: Cannot use ExitCleanly()
Expect(result).Should(Exit(0))
output := result.OutputToString()
Expect(output).To(ContainSubstring(cid))
})
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ var _ = Describe("Podman rm", func() {
Expect(ctr2).Should(ExitCleanly())
cid2 := ctr2.OutputToString()

rm := podmanTest.Podman([]string{"rm", "-fa"})
rm := podmanTest.Podman([]string{"rm", "-t0", "-fa"})
rm.WaitWithDefaultTimeout()
Expect(rm).Should(ExitCleanly())
Expect(rm.ErrorToString()).To(BeEmpty(), "rm -fa error logged")
Expand Down
6 changes: 4 additions & 2 deletions test/e2e/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ VOLUME %s`, ALPINE, volPath, volPath)
ctr.WaitWithDefaultTimeout()
Expect(ctr).Should(ExitCleanly())

stop := podmanTest.Podman([]string{"stop", ctrName})
stop := podmanTest.Podman([]string{"stop", "-t0", ctrName})
stop.WaitWithDefaultTimeout()
Expect(stop).Should(ExitCleanly())

Expand Down Expand Up @@ -1693,13 +1693,15 @@ VOLUME %s`, ALPINE, volPath, volPath)
session := podmanTest.Podman([]string{"create", "--replace", ALPINE, "/bin/sh"})
session.WaitWithDefaultTimeout()
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.
ctrName := "testCtr"
for i := 0; i < 5; i++ {
session := podmanTest.Podman([]string{"run", "--detach", "--replace", "--name", ctrName, ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
// FIXME - #20196: Cannot use ExitCleanly()
Expect(session).Should(Exit(0))

// make sure Podman prints only one ID
Expect(session.OutputToString()).To(HaveLen(64))
Expand Down
7 changes: 2 additions & 5 deletions test/system/050-stop.bats
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,13 @@ load helpers
# stop -a must print the IDs
run_podman run -d $IMAGE top
ctrID="$output"
# Output means container has set up its signal handlers
wait_for_output "Mem:" $ctrID
run_podman stop --all
run_podman stop -t0 --all
is "$output" "$ctrID"

# stop $input must print $input
cname=$(random_string)
run_podman run -d --name $cname $IMAGE top
wait_for_output "Mem:" $cname
run_podman stop $cname
run_podman stop -t0 $cname
is "$output" $cname

run_podman rm -t 0 -f $ctrID $cname
Expand Down
2 changes: 1 addition & 1 deletion test/system/160-volumes.bats
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Labels.l | $mylabel
cid=$output
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"
run_podman volume rm myvol --force
run_podman volume rm myvol --force -t0
}

# Running scripts (executables) from a volume
Expand Down

1 comment on commit bbd4476

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.