Exam 350-901 All QuestionsBrowse all questions from this exam
Question 84

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 and all other containers pass unit and integration testing.

What should be verified to resolve the issue?

    Correct Answer: B

    When a container running a Python script fails during the integration testing phase, it is crucial to verify that the necessary modules and packages are installed on build. Integration tests often rely on multiple external libraries and dependencies that need to be available in the runtime environment. If these modules or packages are missing, the integration tests will fail even if the code itself is correct. Thus, ensuring all required dependencies are included and correctly installed during the build process is essential for the successful execution of integration tests.

Discussion
fechaoOption: A

I choose A

CyphrOption: A

A: does not make sense as the docker file does not expose the ports. The purpose of the EXPOSE command within the docker file is simply for documentation purposes. The port exposure happens at runtime with the -p argument. https://docs.docker.com/engine/reference/builder/#expose "The EXPOSE instruction does not actually publish the port. It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published. To actually publish the port when running the container, use the -p flag on docker run to publish and map one or more ports, or the -P flag to publish all exposed ports and map them to high-order ports."

designatedOption: A

I would choose A if the integration phase is being done by another device/software outside of the container and B if it is not. It will depend on how the environment is deployed and the question is not clear about that.

__al__

pretty much all answers could be right depending on how the integration phase/script/environment was set-up

[Removed]Option: B

It is not A. Like written by Cyphr, this is from the Cisco DEVCOR study guide, page 107: EXPOSE <port>: Does not publish the port but functions as documentation between the person who builds the image and the person who runs the container. To publish the port when running the container, use the -p flag with docker run. I'll go with B.

endermaoOption: A

Agreed with fechao, only wrong exposure of ports can lead to a successful build, other choices will make the building failed at first

Timidwolf

I agree with A. But your reason is not correct. Building still could succeed with other errors. The question implies Unit Test has passed but it failed at Integration Test. The rest is same as thinkingape.

razvan999Option: A

IMO is A unit tests passed so B is out, I would also say C, including reviews (which can be valid for all at the same time) A is because you don't have to use EXPOSE word in Dockerfile, but you can expose the wrong port by starting the app

TeringzooiOption: A

Correct answer: A Build succeeds. Other answers: build would fail.

thinkingape

agree with fechao and endermao, Integration tests are responsible for ensuring that the access to external systems works as expected. Database writes and reads, calls to APIs, and basically every I/O operation your application is performing.

e7bd289Option: B

In the context of a container running a Python script that fails during the integration testing phase of the CI/CD process, verifying that the necessary modules and packages are installed on build is crucial.

kirrimOption: C

The build process succeded on this container, so B and D are ruled out. A is ruled out because the container had the correct port exposed on it during standalone testing, so the dockerfile has the port exposed properly. Only C is left

Zizu007Option: C

Correct answer is C: To resolve the issue of a container running a Python script failing during the integration testing phase, you should verify option: C. that the script is running from the right directory. Integration tests may depend on the working directory from which the script is executed, and if the script is not running from the correct directory, it can lead to failures. Ensure that the script is executing in the appropriate directory with the necessary files and dependencies available. While the other options may also be important in certain cases, such as checking the exposed port or verifying that the required modules are installed, the issue described in the question is related to script execution and directory context. Therefore, verifying that the script is running from the correct directory is the most relevant action to take in this context

johntermlenOption: B

The other options are not as likely to be the cause of the problem. Option A, checking that the correct port is exposed in the Dockerfile, is unlikely to be the cause of the problem because the container is passing unit and integration testing. Option C, checking that the script is running from the right directory, is also unlikely to be the cause of the problem because the code has been reviewed thoroughly. Option D, checking that the Python version of the container image is correct, is also unlikely to be the cause of the problem because all other containers are passing unit and integration testing.

blurainOption: B

Going with B, the issue is happening in integration testing phase. The script might depend on packages that are not available in build

CiscoRiderOption: B

I agree with B as the answer.