From 3999dafbf9b3003efb2c6c79cae82480b7c1d537 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 15 Oct 2026 13:59:26 +0200 Subject: [PATCH 1/2] test(react): Fix flaky react-router-6 aborted SSE console assertion Co-Authored-By: Claude Opus 5.5 --- .../react-router-6/tests/sse.test.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/react-router-6/tests/sse.test.ts b/dev-packages/e2e-tests/test-applications/react-router-6/tests/sse.test.ts index 6b859c9e789c..c987c6f90dc2 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-6/tests/sse.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-6/tests/sse.test.ts @@ -85,11 +85,14 @@ test('Waits for sse streaming when sse has been explicitly aborted', async ({ pa expect(durationInSeconds(httpGet)).toBe(0); // Spans carry no breadcrumbs, so the abort error is validated on the console directly - expect( - consoleMessages.some( - message => message.includes('Could not fetch sse') && message.includes('BodyStreamBuffer was aborted'), - ), - ).toBe(true); + // The abort error is logged asynchronously after the span is sent, so it may not have arrived yet + await expect + .poll(() => + consoleMessages.some( + message => message.includes('Could not fetch sse') && message.includes('BodyStreamBuffer was aborted'), + ), + ) + .toBe(true); }); test('Aborts when stream takes longer than 5s, by not updating the span duration', async ({ page }) => { From 6a5a62d051eeb871f19d93a693033ef5cd38818c Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 16 Oct 2026 08:59:44 +0200 Subject: [PATCH 2/2] test(react): Match the abort error of newer Chromium versions Chromium in Playwright 1.64 rejects the aborted read with the signal's abort reason ("signal is aborted without reason") instead of "BodyStreamBuffer was aborted". Both are AbortErrors. Co-Authored-By: Claude Opus 5.5 --- .../test-applications/react-router-6/tests/sse.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/react-router-6/tests/sse.test.ts b/dev-packages/e2e-tests/test-applications/react-router-6/tests/sse.test.ts index c987c6f90dc2..ef967790bab4 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-6/tests/sse.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-6/tests/sse.test.ts @@ -85,12 +85,11 @@ test('Waits for sse streaming when sse has been explicitly aborted', async ({ pa expect(durationInSeconds(httpGet)).toBe(0); // Spans carry no breadcrumbs, so the abort error is validated on the console directly - // The abort error is logged asynchronously after the span is sent, so it may not have arrived yet + // The abort error is logged asynchronously after the span is sent, so it may not have arrived yet. + // Older Chromium rejects with "BodyStreamBuffer was aborted", newer with the signal's abort reason. await expect .poll(() => - consoleMessages.some( - message => message.includes('Could not fetch sse') && message.includes('BodyStreamBuffer was aborted'), - ), + consoleMessages.some(message => message.includes('Could not fetch sse') && message.includes('AbortError')), ) .toBe(true); });