CI/CD & GitHub Actions (50 Qs)•Part 3: Enterprise Scale, Compliance & Production Hardening (Senior / Staff)
Handling Long-Running Tests: Test splitting, parallel test shards, and Flaky Test quarantine strategies.
senior LevelCode ExamplecicdEnterprise Scale
In Simple Words: When integration test suites exceed 30 minutes, developers stop running tests.
- Parallel Sharding: Split the test suite across multiple identical parallel runners using GitHub matrix sharding:
yaml
strategy: matrix: shard: [1/4, 2/4, 3/4, 4/4] steps: - run: npx playwright test --shard=${{ matrix.shard }} - Flaky Test Quarantine: Automatically flag non-deterministic tests and execute them in a quarantined non-blocking job to keep main deployment paths green while reporting reliability metrics.