Test jobs take long; you want to split a test suite across 5 parallel runners.
BeginnerScenarioGitLab CI
Answer
Situation read → Test sharding.
What I'd do →
test:
parallel: 5
script: ./run-tests.sh --shard $CI_NODE_INDEX/$CI_NODE_TOTAL
Use parallel: matrix: for variants like OS or version.
Why → GitLab starts five jobs and provides CI_NODE_INDEX and CI_NODE_TOTAL.
Interview tip → Balance shards by historical timing to avoid a slow straggler.
More on GitLab CI
How does GitLab CI/CD work at a high level?BeginnerWhat is a GitLab Runner and what executors exist?IntermediateWhat are the types of runners (shared, group, project) and tags?IntermediateHow do `rules:` work and how do they replace `only/except`?IntermediateWhat are workflow rules and how do they prevent duplicate pipelines?AdvancedHow do artifacts and cache differ in GitLab CI?Intermediate