Keep parent finalize alive through popup dispose failures - #37
Open
mmkal wants to merge 1 commit into
Open
Conversation
Cursor bugbot caught that a throwing child asyncDispose (e.g. a popup screencast copy failure) aborted the parent's afterTest/afterTestFinalize, dropping the main page's video artifacts. Child wrap and dispose failures are now collected and rethrown only after the parent's own teardown runs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #36 — this fix (cursor bugbot's finding, confirmed in review there) landed on the branch a few minutes after the squash-merge snapshot, so it missed main.
A throwing popup dispose (e.g. a screencast copy or settle failure) aborted the parent page's
afterTest/afterTestFinalize, silently dropping the main page's video artifacts. Child wrap and dispose failures are now collected and rethrown only after the parent's own teardown runs:🤖 Generated with Claude Code
Session:
b7f6f792-6606-44be-9ec3-207eb762c4b6Note
Medium Risk
Changes test teardown ordering in the plugin system, which affects artifact finalization for pages with auto-wrapped popups; scope is limited to dispose error handling with a targeted regression test.
Overview
Popup teardown errors no longer skip the parent page’s lifecycle. In
addPlugins, child popup pages are disposed before the parent runsafterTest/afterTestFinalize. Previously, a throwing childasyncDispose(not only a failed wrap) could abort teardown before those parent hooks ran, which could drop main-page artifacts such as video output.The dispose loop now collects child wrap rejections and child dispose errors in
childFailures, still runs the parent’s serial lifecycle emissions and cleanups, and rethrows the first child failure only after parent teardown completes.A new popup spec asserts that a popup plugin’s
afterTestFinalizethrow still failspage[Symbol.asyncDispose](), while the parent’safterTestFinalizehandler runs first (eventscontains"parent finalized").Reviewed by Cursor Bugbot for commit ef2f003. Bugbot is set up for automated code reviews on this repo. Configure here.