next.js
8370d498 - test: attempt to de-flake rsc-basic (#77934)

Commit
1 year ago
test: attempt to de-flake rsc-basic (#77934) I've been seeing this test flake with some regularity: --- ● app dir - rsc basics › should be able to navigate between rsc routes ``` request.allHeaders: Target page, context or browser has been closed 168 | page.on('request', (request) => { 169 | requestsCount++ > 170 | return request.allHeaders().then((headers) => { | ^ 171 | if ( 172 | headers['RSC'.toLowerCase()] === '1' && 173 | // Prefetches also include `RSC` at Page.allHeaders (e2e/app-dir/rsc-basic/rsc-basic.test.ts:170:26) ``` --- [Example test run here](https://github.com/vercel/next.js/actions/runs/14313872710/job/40115445718?pr=77898#step:33:3431) The error is actually unrelated to `should be able to navigate between rsc routes`, and is coming from async operations (that haven't completed in time) in another test in the same suite, `should reuse the inline flight response without sending extra requests` . I've de-asyncified the test's `page.on('request')` handler -- we don't need the async `allHeaders()`, `headers()` is enough. (I verified this by adding a client component that manually sends a request with `RSC: 1`, and that does indeed trigger our request listener). I've also added a `waitForIdleNetwork` to hopefully make it complete all requests before the test ends.
Author
Parents
Loading