mirror of
https://github.com/containers/podman.git
synced 2025-10-25 10:16:43 +08:00
sleep does not catch SIGTERM
As Matt pointed out, when running sleep in a container, the clean up was taking a full ten seconds to stop container because sleep does not catch SIGTERM which is the default podman stop signal and it had to wait for SIGKILL. Changing sleep to top should result in better test times. Signed-off-by: baude <bbaude@redhat.com> Closes: #492 Approved by: rhatdan
This commit is contained in:
@ -363,14 +363,14 @@ func (p *PodmanTest) RestoreAllArtifacts() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//RunSleepContainer runs a simple container in the background that
|
||||
// sleeps. If the name passed != "", it will have a name
|
||||
func (p *PodmanTest) RunSleepContainer(name string) *PodmanSession {
|
||||
//RunTopContainer runs a simple container in the background that
|
||||
// runs top. If the name passed != "", it will have a name
|
||||
func (p *PodmanTest) RunTopContainer(name string) *PodmanSession {
|
||||
var podmanArgs = []string{"run"}
|
||||
if name != "" {
|
||||
podmanArgs = append(podmanArgs, "--name", name)
|
||||
}
|
||||
podmanArgs = append(podmanArgs, "-d", ALPINE, "sleep", "90")
|
||||
podmanArgs = append(podmanArgs, "-d", ALPINE, "top")
|
||||
return p.Podman(podmanArgs)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user