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

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

commit 1f75aefe79b8d59fe1636d992da53809457090a7
Author: Maxime Beauchemin <[email protected]>
AuthorDate: Sun Jan 19 11:42:17 2025 -0800

    chore: disable flaky cypress tests
    
    I think we've all had enough of these cypress tests that keep on flaking. I 
tried pretty hard to deflake some of them with limited success.
---
 .github/workflows/superset-e2e.yml               |  2 +-
 docker/docker-init.sh                            | 17 ++++++++++-------
 scripts/cypress_run.py                           |  2 +-
 superset-frontend/cypress-base/cypress.config.ts | 12 ++++++++++--
 4 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/superset-e2e.yml 
b/.github/workflows/superset-e2e.yml
index b5646e8f417..cbf9728f238 100644
--- a/.github/workflows/superset-e2e.yml
+++ b/.github/workflows/superset-e2e.yml
@@ -138,7 +138,7 @@ jobs:
           run: cypress-run-all ${{ env.USE_DASHBOARD }}
       - name: Upload Artifacts
         uses: actions/upload-artifact@v4
-        if: github.event_name == 'workflow_dispatch' && 
(steps.check.outputs.python || steps.check.outputs.frontend)
+        if: failure()
         with:
           path: ${{ github.workspace 
}}/superset-frontend/cypress-base/cypress/screenshots
           name: cypress-artifact-${{ github.run_id }}-${{ github.job }}
diff --git a/docker/docker-init.sh b/docker/docker-init.sh
index b513f52eded..f9bd09ed14d 100755
--- a/docker/docker-init.sh
+++ b/docker/docker-init.sh
@@ -50,12 +50,16 @@ echo_step "1" "Complete" "Applying DB migrations"
 
 # Create an admin user
 echo_step "2" "Starting" "Setting up admin user ( admin / $ADMIN_PASSWORD )"
-superset fab create-admin \
-    --username admin \
-    --firstname Superset \
-    --lastname Admin \
-    --email [email protected] \
-    --password "$ADMIN_PASSWORD"
+if [ "$CYPRESS_CONFIG" == "true" ]; then
+    superset load_test_users
+else
+    superset fab create-admin \
+        --username admin \
+        --email [email protected] \
+        --password "$ADMIN_PASSWORD" \
+        --firstname Superset \
+        --lastname Admin
+fi
 echo_step "2" "Complete" "Setting up admin user"
 # Create default roles and permissions
 echo_step "3" "Starting" "Setting up roles and perms"
@@ -67,7 +71,6 @@ if [ "$SUPERSET_LOAD_EXAMPLES" = "yes" ]; then
     echo_step "4" "Starting" "Loading examples"
     # If Cypress run which consumes superset_test_config – load required data 
for tests
     if [ "$CYPRESS_CONFIG" == "true" ]; then
-        superset load_test_users
         superset load_examples --load-test-data
     else
         superset load_examples
diff --git a/scripts/cypress_run.py b/scripts/cypress_run.py
index 7c99788d0a7..7531aad8daf 100644
--- a/scripts/cypress_run.py
+++ b/scripts/cypress_run.py
@@ -20,7 +20,7 @@ import os
 import subprocess
 from datetime import datetime
 
-XVFB_PRE_CMD = "xvfb-run --auto-servernum --server-args='-screen 0, 
1024x768x24' "
+XVFB_PRE_CMD = "xvfb-run --auto-servernum --server-args='-screen 0, 
1280x1024x24' "
 REPO = os.getenv("GITHUB_REPOSITORY") or "apache/superset"
 GITHUB_EVENT_NAME = os.getenv("GITHUB_EVENT_NAME") or "push"
 CYPRESS_RECORD_KEY = os.getenv("CYPRESS_RECORD_KEY") or ""
diff --git a/superset-frontend/cypress-base/cypress.config.ts 
b/superset-frontend/cypress-base/cypress.config.ts
index 391856d874c..2eaed82cb0a 100644
--- a/superset-frontend/cypress-base/cypress.config.ts
+++ b/superset-frontend/cypress-base/cypress.config.ts
@@ -26,7 +26,7 @@ export default eyesPlugin(
   defineConfig({
     chromeWebSecurity: false,
     defaultCommandTimeout: 8000,
-    numTestsKeptInMemory: 5,
+    numTestsKeptInMemory: 3,
     // Disabled after realizing this MESSES UP rison encoding in intricate ways
     experimentalFetchPolyfill: false,
     experimentalMemoryManagement: true,
@@ -58,7 +58,15 @@ export default eyesPlugin(
             });
 
             launchOptions.args.push(
-              ...['--disable-dev-shm-usage', '--disable-gpu'],
+              '--disable-dev-shm-usage',
+              '--disable-gpu',
+              '--no-sandbox',
+              '--disable-software-rasterizer',
+              '--memory-pressure-off',
+              '--js-flags=--max-old-space-size=4096',
+              '--disable-background-timer-throttling',
+              '--disable-backgrounding-occluded-windows',
+              '--disable-renderer-backgrounding',
             );
           }
           return launchOptions;

Reply via email to