Skip to content

test(remote-react-components): keep the cross-version harness in one tester iframe - #3124

Merged
mfal merged 1 commit into
mainfrom
fix/cross-version-harness-iframe-leak
Sep 4, 2026
Merged

test(remote-react-components): keep the cross-version harness in one tester iframe#3124
mfal merged 1 commit into
mainfrom
fix/cross-version-harness-iframe-leak

Conversation

@mfal

@mfal mfal commented Sep 3, 2026

Copy link
Copy Markdown
Member

The in-process cross-version run dies mid-suite in the label workflow: Browser connection was closed while running tests. Was the page closed unexpectedly? at file 60 of 84 — 59 files and 150 tests green, no test failure of its own. Seen on the run-cross-version-tests label run of #3084, which is otherwise unrelated to this.

Cause

The WebKit iframe leak from #3119. Vitest gives every test file a fresh tester iframe and removes the previous one, and Playwright's WebKit never releases a removed iframe's document — component library, all.css, fonts and last render stay alive, roughly 200 MB per file.

e2e/cross-version-inprocess/vitest.config.ts inherits the shared browser config but never got the isolate: false that #3119 put on the package's visual project. It reuses the same corpus that killed the unsharded update-screenshots run, on one browser, so it hits the same wall.

The scheduled workflow survives only because it shards the run three ways (FLOW_CROSS_VERSION_SHARD=n/3, ~28 files per shard — under the threshold). test-cross-version-label.yml runs all 84 files in one process, so the failure shows up there alone.

Change

  • isolate: false — one tester iframe for the whole run. The shared realm suits this harness: setup.ts's first-wins customElements.define patch keeps the OLD flr-* registrations for the whole run, and one run covers exactly one version anyway.
  • fileParallelism moves out of browser, where vitest 4 deprecates it in favour of the top-level option. Behaviour unchanged — the run was already serial.

No sharding added to the label workflow: without the per-file iframe churn there is nothing left to accumulate, and the run is now short enough that shard setup would cost more than it saves.

Verification

Ran the exact reference pass that failed in CI (FLOW_CROSS_VERSION=current … --update):

before (CI) after (local)
test files 59 passed, died at 60 of 84 84/84 passed
tests 150 179
duration 243 s 86 s
import 129.7 s 3.3 s

The import collapse is the library being loaded once instead of per file. The label run on this PR exercises the full path.

related #3119

…tester iframe

The in-process cross-version run dies mid-suite in the label workflow:
`Browser connection was closed while running tests. Was the page closed
unexpectedly?` at file 60 of 84, with 59 files and 150 tests green and no
test failure of its own.

This is the WebKit iframe leak from #3119. Vitest gives every test file a
fresh tester iframe and removes the previous one, and Playwright's WebKit
never releases a removed iframe's document — component library, all.css,
fonts and last render stay alive, about 200 MB per file. The harness config
inherits the shared browser config but never got the `isolate: false` that
#3119 put on the package's `visual` project, so the corpus that killed the
unsharded `update-screenshots` run kills this one too.

The scheduled workflow survives only because it shards the run three ways
(~28 files per shard, under the threshold). The label workflow runs all 84
in one process, so the failure shows up there alone.

The shared realm suits this harness: `setup.ts`'s first-wins
`customElements.define` patch keeps the OLD flr-* registrations for the
whole run, and one run covers exactly one version anyway.

Also moves `fileParallelism` out of `browser`, where vitest 4 deprecates it
in favour of the top-level option. Behaviour is unchanged — the run was
already serial.

Verified with the reference pass that failed in CI: 84/84 files, 179 tests,
and 86s instead of 243s, because the library is imported once rather than
per file (import 3.3s instead of 129.7s).
@mfal
mfal requested a review from a team September 3, 2026 12:45
@mfal mfal self-assigned this Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.69% 746 / 948
🔵 Statements 78.57% 763 / 971
🔵 Functions 80.09% 165 / 206
🔵 Branches 70.33% 377 / 536
File CoverageNo changed files found.
Generated in workflow #6663 for commit 8d757ff by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3124.docs.review.flow-components.de
storybook pr-3124.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3124
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3124

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ Cross-Version Tests Passed

The current host still renders old published remote versions correctly (iframe) and in the same DOM shape (in-process).

Iframe harness (attribute-accurate): ✅ passed

In-process harness (structure-only): ✅ passed

Run details

@mfal
mfal enabled auto-merge (squash) September 3, 2026 13:12
@mfal
mfal merged commit ab1598d into main Sep 4, 2026
27 checks passed
@mfal
mfal deleted the fix/cross-version-harness-iframe-leak branch September 4, 2026 04:15
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.

2 participants