Skip to content

Commit 3cb1b2b

Browse files
fix: Workaround for Cypress ECONNRESET error (apache#25399)
1 parent 0be9f32 commit 3cb1b2b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

superset-frontend/cypress-base/cypress.config.ts

+17
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ export default defineConfig({
3838
// We've imported your old cypress plugins here.
3939
// You may want to clean this up later by importing these.
4040
setupNodeEvents(on, config) {
41+
// ECONNRESET on Chrome/Chromium 117.0.5851.0 when using Cypress <12.15.0
42+
// Check https://github.com/cypress-io/cypress/issues/27804 for context
43+
// TODO: This workaround should be removed when upgrading Cypress
44+
on('before:browser:launch', (browser, launchOptions) => {
45+
if (browser.name === 'chrome' && browser.isHeadless) {
46+
// eslint-disable-next-line no-param-reassign
47+
launchOptions.args = launchOptions.args.map(arg => {
48+
if (arg === '--headless') {
49+
return '--headless=new';
50+
}
51+
52+
return arg;
53+
});
54+
}
55+
return launchOptions;
56+
});
57+
4158
// eslint-disable-next-line global-require,import/extensions
4259
return require('./cypress/plugins/index.js')(on, config);
4360
},

0 commit comments

Comments
 (0)