mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
Robustify nginx tests
[skip ci] While chasing a flake, I discovered that our alpine_nginx image is broken: it returns 404 on all requests. We never caught this because--surprise!--curl exits 0 even when server returns 4xx/5xx status. Let's be strict: add -f (--fail) option to all invocations of curl. And, although I couldn't identify the root cause of the flake (in "run two containers with the same IP" test), I can at least fix the broken wait-for-nginx loop, bump up the number of retries, and improve diagnostics on failure. And add a strict error-message check. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@ -462,7 +462,8 @@ func (p *PodmanTestIntegration) RunNginxWithHealthCheck(name string) (*PodmanSes
|
||||
if name != "" {
|
||||
podmanArgs = append(podmanArgs, "--name", name)
|
||||
}
|
||||
podmanArgs = append(podmanArgs, "-dt", "-P", "--health-cmd", "curl http://localhost/", nginx)
|
||||
// curl without -f exits 0 even if http code >= 400!
|
||||
podmanArgs = append(podmanArgs, "-dt", "-P", "--health-cmd", "curl -f http://localhost/", nginx)
|
||||
session := p.Podman(podmanArgs)
|
||||
session.WaitWithDefaultTimeout()
|
||||
return session, session.OutputToString()
|
||||
|
Reference in New Issue
Block a user