This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new c508a335e6 fix: Workaround for Cypress ECONNRESET error (#25399)
c508a335e6 is described below

commit c508a335e642c7f9f2dbd0c2fa0d25cd95219fce
Author: Michael S. Molina <[email protected]>
AuthorDate: Mon Sep 25 17:39:06 2023 -0300

    fix: Workaround for Cypress ECONNRESET error (#25399)
    
    (cherry picked from commit d76ff39766409d9240191b58b699e5f4ec9afa2f)
---
 superset-frontend/cypress-base/cypress.config.ts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/superset-frontend/cypress-base/cypress.config.ts 
b/superset-frontend/cypress-base/cypress.config.ts
index 1d2c3baf49..7340830bf0 100644
--- a/superset-frontend/cypress-base/cypress.config.ts
+++ b/superset-frontend/cypress-base/cypress.config.ts
@@ -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);
     },

Reply via email to