Skip to content

Avoided real docker/podman container CLI check for tests - #537

Merged
venmanyarun merged 1 commit into
OpenLiberty:mainfrom
sajeerzeji:fix/real_container_cli_check_in_tests
Sep 2, 2026
Merged

Avoided real docker/podman container CLI check for tests#537
venmanyarun merged 1 commit into
OpenLiberty:mainfrom
sajeerzeji:fix/real_container_cli_check_in_tests

Conversation

@sajeerzeji

Copy link
Copy Markdown
Contributor

When Docker is not running but installed in the system, the printPortInfo tests were failing.

The root cause was the test already mocks the container state, but printPortInfo also triggers real CLI calls, first running docker version / podman version to detect the container engine, then fetching network info. When Docker is installed but not running, the version check throws a RuntimeException, and will fail the tests. In CI it works because no docker or podman installed.

Fixed this by overriding execContainerCmdWithPrefix to return null in BaseDevUtilTest, so it will never call the real docker or podman CLI.

@venmanyarun

Copy link
Copy Markdown
Contributor

@sajeerzeji
can you add screenshots of runnning ci.common tests with podman stopped?

@sajeerzeji

Copy link
Copy Markdown
Contributor Author

@sajeerzeji can you add screenshots of runnning ci.common tests with podman stopped?

Before implementing the fix:

Screen.Recording.2026-09-02.at.10.46.29.AM.mov

After implementing the fix:

Screen.Recording.2026-09-02.at.10.48.09.AM.mov

@venmanyarun
venmanyarun merged commit b526d88 into OpenLiberty:main Sep 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants