350-901 · Question #67
A container running a Python script is failing when it reaches the integration testing phase of the CI/CD process. The code has been reviewed thoroughly and the build process works on this container…
The correct answer is A. that the correct port is exposed in the Dockerfile. When a container passes unit tests but fails integration tests due to connectivity issues, the Dockerfile must be verified to ensure the required port is exposed for inter-service communication.
Question
Options
- Athat the correct port is exposed in the Dockerfile
- Bthat the necessary modules and packages are installed on build
- Cthat the script is running from the night directory
- Dthat the Python version of the container image is correct
How the community answered
(19 responses)- A79% (15)
- B5% (1)
- C11% (2)
- D5% (1)
Why each option
When a container passes unit tests but fails integration tests due to connectivity issues, the Dockerfile must be verified to ensure the required port is exposed for inter-service communication.
Integration testing requires the container to accept inbound network connections from other services or test harnesses; if the EXPOSE directive in the Dockerfile is missing or specifies the wrong port, external processes cannot reach the Python script's listening service, causing integration failures while unit tests - which run in isolation - still pass.
If necessary modules were missing, the build process itself would fail or the unit tests would also fail, but the question states the build works and unit tests pass.
An incorrect working directory would cause failures at startup or during all test phases, not specifically at integration testing while unit tests pass.
An incorrect Python version would cause syntax or compatibility errors visible during build or unit testing, not selectively during integration testing.
Concept tested: Dockerfile EXPOSE directive for container integration testing
Source: https://docs.docker.com/reference/dockerfile/#expose
Topics
Community Discussion
No community discussion yet for this question.