300-910 · Question #93
Refer to the exhibit. A developer is implementing a GitLab CI/CD pipeline for the first time. A project has been created in GitLab and the developer has ensured runners are available. Which instructio
The correct answer is A. Four jobs, Job A and Job B run in parallel, and Job B will complete at least 20 seconds later than Job A.. The GitLab CI/CD YAML specifies four jobs: job_A, job_B, test-jobA, and test-jobB. By default, jobs in the same stage run in parallel.
Question
Options
- AFour jobs, Job A and Job B run in parallel, and Job B will complete at least 20 seconds later than Job A.
- BThree jobs, after test-jobB runs a simulated test runs for 20 minutes longer than test-jobA
- CThree jobs, after test-jobB runs a simulated test runs for 20 seconds longer than test-jobA
- DFour jobs, Job B will run sequentially after Job A, and Job B will run at least 20 seconds longer
How the community answered
(48 responses)- A77% (37)
- B6% (3)
- C4% (2)
- D13% (6)
Why each option
The GitLab CI/CD YAML specifies four jobs: `job_A`, `job_B`, `test-jobA`, and `test-jobB`. By default, jobs in the same stage run in parallel.
The YAML defines four distinct jobs. In GitLab CI/CD, jobs defined without an explicit `stage` are assigned to the default `test` stage, and jobs within the same stage run in parallel unless specific dependencies are configured. Both `job_A` (20s sleep) and `job_B` (40s sleep) are in the default stage and will run concurrently, meaning `job_B` will complete at least 20 seconds after `job_A`.
The pipeline explicitly defines four jobs, not three. Additionally, the time difference between `job_A` and `job_B` completion is 20 seconds, not 20 minutes.
There are four jobs, not three. Also, `test-jobA` and `test-jobB` will run in parallel if they are in the same stage and no `needs` or `dependencies` are specified, so `test-jobB` does not necessarily run 'after' `test-jobA`.
Jobs `job_A` and `job_B` will run in parallel by default because they are in the same stage and no explicit sequential execution (e.g., via `needs` keyword) is defined between them.
Concept tested: GitLab CI/CD job execution flow
Source: https://docs.gitlab.com/ee/ci/yaml/#stages
Topics
Community Discussion
No community discussion yet for this question.