Skip to content

Commit

Permalink
fix: Workaround for Cypress ECONNRESET error (apache#25399)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Sep 25, 2023
1 parent e1a91e2 commit d76ff39
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions superset-frontend/cypress-base/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ export default defineConfig({
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
// ECONNRESET on Chrome/Chromium 117.0.5851.0 when using Cypress <12.15.0
// Check https://github.com/cypress-io/cypress/issues/27804 for context
// TODO: This workaround should be removed when upgrading Cypress
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
// eslint-disable-next-line no-param-reassign
launchOptions.args = launchOptions.args.map(arg => {
if (arg === '--headless') {
return '--headless=new';
}

return arg;
});
}
return launchOptions;
});

// eslint-disable-next-line global-require,import/extensions
return require('./cypress/plugins/index.js')(on, config);
},
Expand Down

0 comments on commit d76ff39

Please sign in to comment.