Challenge - 5 Problems
Parallel Test Execution Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Jenkins Pipeline Parallel Stage Output
Given the following Jenkins pipeline snippet, what will be the output order of the stages when executed?
Jenkins
pipeline {
agent any
stages {
stage('Parallel Tests') {
parallel {
stage('Test A') {
steps {
echo 'Running Test A'
}
}
stage('Test B') {
steps {
echo 'Running Test B'
}
}
}
}
}
}Attempts:
2 left
💡 Hint
Think about how Jenkins runs parallel stages in the pipeline.
✗ Incorrect
In Jenkins, stages defined inside a parallel block run at the same time. Their output messages can appear interleaved or nearly simultaneously in the console.
❓ Configuration
intermediate2:00remaining
Configuring Parallel Test Execution in Jenkinsfile
Which Jenkinsfile snippet correctly configures two test suites to run in parallel with separate agents?
Attempts:
2 left
💡 Hint
Remember the correct syntax for parallel stages inside a Jenkins pipeline.
✗ Incorrect
In declarative Jenkins pipelines, parallel stages are defined inside a parallel block with nested stage blocks, each can have its own agent and steps.
❓ Troubleshoot
advanced2:00remaining
Troubleshooting Parallel Stage Failure in Jenkins
You have a Jenkins pipeline with parallel test stages. One stage fails but the others continue running. Which configuration causes this behavior?
Jenkins
pipeline {
agent any
stages {
stage('Parallel Tests') {
parallel {
stage('Test 1') {
steps {
error 'Test 1 failed'
}
}
stage('Test 2') {
steps {
echo 'Test 2 running'
}
}
}
}
}
}Attempts:
2 left
💡 Hint
Consider Jenkins default behavior for parallel stage failures.
✗ Incorrect
By default, Jenkins runs parallel stages independently. If one fails, others continue unless failFast true is set.
🔀 Workflow
advanced2:00remaining
Optimizing Parallel Test Execution Workflow
You want to run 10 test suites in parallel but limit Jenkins to run only 3 at a time to avoid resource overload. Which approach achieves this?
Attempts:
2 left
💡 Hint
Think about Jenkins plugins that control concurrency.
✗ Incorrect
The throttleConcurrentBuilds plugin allows limiting the number of concurrent builds or parallel executions to control resource usage.
✅ Best Practice
expert2:00remaining
Best Practice for Sharing Data Between Parallel Stages
In a Jenkins pipeline with parallel test stages, you want to share a file generated by one stage with another stage running in parallel. What is the best practice to achieve this?
Attempts:
2 left
💡 Hint
Consider how Jenkins isolates parallel stages and how files can be shared safely.
✗ Incorrect
Parallel stages may run on different agents or separate workspaces. Using stash and unstash steps is the recommended way to share files safely between stages.