Run tests concurrently for maximum throughput and faster CI pipelines
Speed up your test suite by running multiple tests simultaneously. TestDriver’s parallel execution capabilities let you maximize throughput and reduce overall test duration.
// Development: Lower concurrency for easier debuggingmaxConcurrency: 3// CI: Higher concurrency for speedmaxConcurrency: 20
Balance speed with resource usage. Too many concurrent tests can overwhelm your system or CI runner.Guidelines:
Local development: 3-5 concurrent tests
CI with 2 CPUs: 5-10 concurrent tests
CI with 4+ CPUs: 10-20 concurrent tests
2. Ensure Test Isolation
Copy
// ✅ Good - each test is isolatedtest('login test 1', async (context) => { const { testdriver } = await chrome(context, { url: 'https://example.com' }); // Test runs in its own sandbox});test('login test 2', async (context) => { const { testdriver } = await chrome(context, { url: 'https://example.com' }); // Different sandbox, no interference});
TestDriver automatically provisions isolated sandboxes for each test, preventing interference.
3. Monitor Resource Usage
Copy
# Watch CPU and memory during test runs# macOStop -l 1 | grep -E "(CPU|PhysMem)"# Linuxtop -bn1 | grep "Cpu(s)"# Adjust maxConcurrency if system is overwhelmed
Keep an eye on system resources to find the optimal concurrency level.