From 3ef0572fa2e1e8eeb8c2f1316ab5f6354a557fe2 Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Thu, 8 Jan 2026 14:09:10 +0100 Subject: [PATCH] test(nuxt): Wait for the dev port to be available --- .../nuxt-4/nuxt-start-dev-server.bash | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/nuxt-start-dev-server.bash b/dev-packages/e2e-tests/test-applications/nuxt-4/nuxt-start-dev-server.bash index 1204eabb7c87..bbb032c86a67 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/nuxt-start-dev-server.bash +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/nuxt-start-dev-server.bash @@ -45,5 +45,23 @@ fi echo "Starting nuxt dev with Sentry server config..." -# 4. Start the actual dev command which should be used for the tests -NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev +# 4. Start the actual dev command in the background first +NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev & +DEV_PID=$! + +# 5. Wait for port 3030 to be ready before Playwright starts running tests +echo "Waiting for port 3030 to be ready..." +COUNTER=0 +while ! nc -z localhost 3030 2>/dev/null && [ $COUNTER -lt 60 ]; do + sleep 0.5 + ((COUNTER++)) +done + +if nc -z localhost 3030 2>/dev/null; then + echo "Port 3030 is ready!" +else + echo "WARNING: Port 3030 not ready after 30 seconds" +fi + +# 6. Keep the script running (wait for the background process) +wait $DEV_PID