dcermak / pytest_container

Collection of pytest helpers and fixtures to test container images
GNU Lesser General Public License v2.1
31 stars 17 forks source link

not waiting for healthchecks in BCI-tests 389ds tests #154

Closed dirkmueller closed 1 year ago

dirkmueller commented 1 year ago
OS_VERSION=tumbleweed tox -e 389ds -- -k 'test_ldapwhoami'

FAILED tests/test_389ds.py::test_ldapwhoami[opensuse/389-ds:2.4 from registry.opensuse.org/devel/bci/tumbleweed/containerfile/opensuse/389-ds:2.4] - AssertionError: Unexpected exit code 1 for CommandResult(command=b'dsconf localhost backend create --suffix dc=example,dc=com --be-name...
======================================================= 1 failed, 2 skipped in 2.48s =======================================================
389ds: exit 1 (2.94 seconds) 

so it fails within 3 seconds, but the docker file actually has a healthcheck start for 5m:

HEALTHCHECK --start-period=5m --timeout=5s --interval=5s --retries=2

which seems to indicate to me that healthchecks are not respected. any idea how to debug further?

dcermak commented 1 year ago

This is not a pytest_container bug, the image has no healtcheck.

The actual problem is the following entry in the openSUSE:Factory prjconf:

  BuildEngine: podman

podman uses the oci image format by default and not the docker format, but only the docker format supports healtcheck. Hence the image gets build but no healthcheck is created.

You can also see that in the build log:

[   41s] time="2023-08-13T18:49:24Z" level=warning msg="HEALTHCHECK is not supported for OCI image format and will be ignored. Must use `docker` format"