DOP-C02 SDLC Automation Practice Question
A DevOps team uses AWS CodePipeline to deploy a microservices application. The pipeline includes a CodeBuild project that runs unit tests. Recently, builds have been failing intermittently due to test timeouts. The team wants to improve the reliability of the pipeline without increasing the build timeout. Which action should the team take?
⚠ Common exam trap
Many exam-takers confuse increasing the timeout (Option A) as a valid fix for intermittent failures, when the correct approach is to optimize test execution time through parallelism rather than extending the timeout window.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Configure the CodeBuild project to run tests in parallel by using separate build environments or test splits.
Running unit tests in parallel using separate build environments or test splits directly addresses intermittent timeouts by reducing the total execution time without increasing the build timeout. This approach leverages CodeBuild's ability to run multiple build jobs concurrently, distributing the test load and improving pipeline reliability.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the build timeout to the maximum allowed value of 8 hours.
Why it's wrong here
Raising the CodeBuild timeout limit to the maximum (8 hours) merely delays the execution cutoff; it does not eliminate the underlying cause of intermittent timeouts. If the test suite is genuinely slow or resource-constrained, the build will still exceed even an extended limit, and you remain exposed to higher compute costs while the pipeline stays in a failed state longer. The issue should be resolved by reducing test execution time, not by adjusting a threshold.
- ✗
Use AWS CodeDeploy to run the unit tests on EC2 instances with more CPU and memory.
Why it's wrong here
AWS CodeDeploy is designed to automate application deployments to EC2 instances, on-premises instances, or Lambda functions; it is not a test execution service and cannot run your unit tests directly. Even if you used a custom deployment lifecycle hook to invoke tests, provisioning more CPU/memory on an EC2 instance is a vertical scaling workaround that fails to address why the test suite is slow or non-deterministic, and it introduces infrastructure management overhead that CodeBuild already abstracts. The appropriate fix is to optimize the build/test process within CodeBuild, not to repurpose a deployment service.
- ✗
Modify the unit tests to be non-flaky by adding retries for network calls.
Why it's wrong here
Adding retries to network calls can mask flaky network behavior, but it does not reduce the total time required for the test suite to complete; in fact, retries and backoff attempts can lengthen execution and increase the chance of hitting the CodeBuild timeout. The scenario points to a timeout on the entire CodeBuild project, which is most directly caused by test execution exceeding the configured limit, not necessarily by a few unstable network-dependent tests. Simply patching individual tests does not structurally shorten the test suite or prevent slow tests from overwhelming the build timeout.
- ✓
Configure the CodeBuild project to run tests in parallel by using separate build environments or test splits.
Why this is correct
CodeBuild supports batch builds and test splitting (e.g., dividing the test suite into shards and running them across multiple concurrent build environments), which can dramatically reduce wall-clock time and keep the build under the timeout threshold. With Amazon CodeBuild's batch configuration, you can define a buildspec that splits tests by file, directory, or using tools like pytest-xdist, and CodeBuild orchestrates concurrent execution. This directly addresses the root cause by parallelizing CPU-intensive work rather than extending the deadline or masking flaky tests.
Go deeper
Related to this question
About these practice questions
One of 251 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.