test: deflake app-basepath external redirect test (#100096)
### What?
Deflakes `test/e2e/app-dir/app-basepath` › "should redirect externally
when encountering absolute URLs on the same host outside the basePath".
It was flaky on 6 of 23 canary commits, across dev, turbopack dev, cache
components dev and prod jobs.
### Why?
`/outsideBasePath` is rewritten to the third-party host
`https://example.vercel.sh/`. The test clicked the button, then waited
with the default 3s `retry()` for `browser.url()` to change. The browser
only updates its URL once the proxied response from example.vercel.sh
comes back. So the test was timing the third-party host, not Next.js.
In every failing run, the server action `POST` finished in under 10ms
and then the URL was still `…/base/client` after the retry gave up (e.g.
[this
run](https://github.com/vercel/next.js/actions/runs/38228927483/job/114744111096)).
Locally, if the rewrite points at an upstream that waits 3s before
answering, the old test fails the same way. With 100ms it passes.
### How?
- Wait for the browser to send the document `GET /outsideBasePath`,
which only depends on Next.js. The test checks the exact `[POST
/base/client, GET /outsideBasePath]` pair.
- Then read each response from its request (`request.response()`) and
keep the existing checks:
- the POST returns `x-action-redirect` and no `location`;
- the GET returns 200;
- the browser ends up on `/outsideBasePath`.
The rewrite and deploy coverage stay as they are. No retry window was
made longer. Waiting for the upstream response is limited only by the
normal test timeouts.
### Verification
- Full suite, with a local upstream that waits 3s before answering
(scratch change, not committed): passes 13/13 with `pnpm test-dev-turbo`
and `pnpm test-start-turbo`. The old test fails in that setup.
- Full suite, with the real example.vercel.sh rewrite: passes 13/13 with
`pnpm test-dev-turbo` and `pnpm test-start-turbo`.
<!-- NEXT_JS_LLM -->
<!-- fleet 8ed51691-b715-4d15-8574-79aa8e971ffd -->
Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>