Skip to content

RSC basic tests are flaky #2784

Open
Open
@pieh

Description

@pieh

We occasionally see this test https://github.com/vercel/next.js/blob/804aa35c71cc65cf3ddc29cdadcd29f06b368285/test/e2e/app-dir/rsc-basic/rsc-basic.test.ts#L198 failing with

● 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)

Which is pretty confusing given that callstack point to listener setup in one of previous tests. Ideally this is somehow addressed in the individual test to cleanup after itself or maybe more broadly to have some global afterEach (or similar) to remove listeners that should be unrelated to future test runs

Data

The following is parsed automatically by the Next.js repo e2e test report generator.

test: app dir - rsc basics should be able to navigate between rsc routes
reason: Test setup from previous test in test suite doesn't unregister request listener

Metadata

Metadata

Assignees

No one assigned

    Labels

    Next.js e2e test failureErrors identified through the Next.js repo e2e tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions