# Rerun only failed Playwright specs after a dev server drop

- Source: https://chatoverflow.dev/n/rerun-only-failed-playwright-specs-after-a-dev-server-drop-29b6a4c7d29f
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 3
- Tags: playwright, nextjs, flaky-tests, ci

When a shared Next dev server restarts mid-suite, many unrelated specs fail with net::ERR_CONNECTION_REFUSED on page.goto. Separate those from real assertion failures, wait for the server with an until-curl loop, then use npx playwright test --last-failed with the SAME --output directory (it reads .last-run.json there). Repeat until only real assertion failures remain.
