Skip to content

chore(test runner): abort operations when tests end#41751

Closed
Skn0tt wants to merge 3 commits into
microsoft:mainfrom
Skn0tt:skn0tt-default-test-abort-signal
Closed

chore(test runner): abort operations when tests end#41751
Skn0tt wants to merge 3 commits into
microsoft:mainfrom
Skn0tt:skn0tt-default-test-abort-signal

Conversation

@Skn0tt

@Skn0tt Skn0tt commented Jul 13, 2026

Copy link
Copy Markdown
Member

This PR gives test-owned browser contexts a per-test default AbortSignal and aborts it before fixture teardown. This ends in-flight operations without using context closure as the cancellation mechanism, while manually managed contexts can still span test boundaries.

Abort errors keep their generic message and exact cause; the test-end reason remains in call logs.

Skn0tt added 2 commits July 13, 2026 09:58
Use a per-test default abort signal for operations on test-owned contexts while leaving manually managed contexts alone.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c410729d-7f68-4448-8ec3-6ce61ce68388
Use the transmitted abort reason as the server AbortError message so reporter operation errors remain useful.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c410729d-7f68-4448-8ec3-6ce61ce68388
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Skn0tt Skn0tt changed the title feat(test runner): abort operations when tests end chore(test runner): abort operations when tests end Jul 13, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Let dependent fixtures drain in-flight Playwright work before aborting
remaining operations. Keep the controller local to each context fixture
and preserve the existing unhandled rejection behaviour.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c410729d-7f68-4448-8ec3-6ce61ce68388
@Skn0tt Skn0tt marked this pull request as ready for review July 13, 2026 09:59
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

2 failed
❌ [chromium-library] › library/page-close.spec.ts:212 › should not throw when continuing after page is closed @chromium-ubuntu-22.04-arm-node20
❌ [webkit-page] › page/interception.spec.ts:24 › should work with navigation @smoke @webkit-ubuntu-22.04-node20

13 flaky ⚠️ [chromium-library] › library/page-close.spec.ts:212 › should not throw when continuing after page is closed `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:717 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-page] › page/page-request-intercept.spec.ts:269 › request.postData is not null when fetching FormData with a Blob `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/page-close.spec.ts:212 › should not throw when continuing after page is closed `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/page-close.spec.ts:212 › should not throw when continuing after page is closed `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:645 › screencast › should capture full viewport `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/page-close.spec.ts:212 › should not throw when continuing after page is closed `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-page] › page/interception.spec.ts:24 › should work with navigation @smoke `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-page] › page/page-request-intercept.spec.ts:269 › request.postData is not null when fetching FormData with a Blob `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/page-close.spec.ts:212 › should not throw when continuing after page is closed `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:717 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-page] › page/page-request-intercept.spec.ts:269 › request.postData is not null when fetching FormData with a Blob `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:827 › should update state on subsequent run `@windows-latest-node22`

49533 passed, 1161 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

7760 passed, 1249 skipped


Merge workflow run.

@Skn0tt

Skn0tt commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

good experiment!

@Skn0tt Skn0tt closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant