Skip to content

Commit b10e0df

Browse files
committed
ci(testing): reduce e2e test parallelism in CI to fix flaky tests
Work around Stencil v4 e2e test parallelization issues that cause random timeouts in CI but not locally. Changes only apply when CI=true. - Add --disable-gpu browser arg in stencil.config.ts - Add --max-workers=2 in run-tests.cjs See: stenciljs/core#6157
1 parent 9806464 commit b10e0df

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

scripts/run-tests.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ const isDebug =
2525

2626
const args = ['test', '--spec', '--e2e'];
2727

28+
// Reduce parallelism in CI to work around Stencil v4 e2e test issues
29+
// See: https://github.com/stenciljs/core/issues/6157
30+
if (isCI) {
31+
args.push('--max-workers=2');
32+
console.log('CI detected, reducing parallelism with --max-workers=2');
33+
}
34+
2835
// Add verbose flag if debug mode is enabled
2936
if (isDebug) {
3037
args.push('--verbose');

stencil.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ export const config: Config = {
5353
tsconfig: './tsconfig.dev.json',
5454
globalStyle: 'src/global/core-styles.scss',
5555
testing: {
56-
browserArgs: ['--enable-experimental-web-platform-features'],
56+
browserArgs: [
57+
'--enable-experimental-web-platform-features',
58+
// Disable GPU in CI to work around Stencil v4 e2e test parallelization issues
59+
// See: https://github.com/stenciljs/core/issues/6157
60+
...(process.env.CI ? ['--disable-gpu'] : []),
61+
],
5762
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
5863
moduleNameMapper: {
5964
'^lodash-es$': 'lodash',

0 commit comments

Comments
 (0)