diff --git a/.github/workflows/bashlib.sh b/.github/workflows/bashlib.sh index 76f44d28f1b..5874ba68642 100644 --- a/.github/workflows/bashlib.sh +++ b/.github/workflows/bashlib.sh @@ -175,9 +175,12 @@ cypress-run-all() { local APP_ROOT=$2 cd "$GITHUB_WORKSPACE/superset-frontend/cypress-base" - # Start Flask and run it in background - # --no-debugger means disable the interactive debugger on the 500 page - # so errors can print to stderr. + # Start the Superset backend via gunicorn (not `flask run`). The Flask + # development server is single-threaded and has no crash-recovery, so + # heavy tests (dashboard import/export, SQL Lab) can knock it offline + # for the rest of the run — surfacing as `ECONNREFUSED` / `socket hang up` + # / `Missing CSRF token` cascades. Gunicorn gives us multiple workers, + # a request timeout, and worker-recycling under load. local flasklog="${HOME}/flask.log" local port=8081 CYPRESS_BASE_URL="http://localhost:${port}" @@ -187,7 +190,18 @@ cypress-run-all() { fi export CYPRESS_BASE_URL - nohup flask run --no-debugger -p $port >"$flasklog" 2>&1 "$flasklog" 2>&1 "$flasklog" 2>&1 "$flasklog" 2>&1 /dev/null 2>&1; then - say "Flask server is ready" + say "gunicorn server is ready" break fi sleep 1 @@ -254,8 +281,8 @@ playwright-run() { done if [ $timeout -eq 0 ]; then - echo "::error::Flask server failed to start within 60 seconds" - echo "::group::Flask startup log" + echo "::error::gunicorn server failed to start within 60 seconds" + echo "::group::Server startup log" cat "$flasklog" echo "::endgroup::" return 1