Skip to content

test(e2e): the reload storm names a crash of webkit's network process instead of reading it as lost tasks - #573

Merged
arrzdev merged 1 commit into
mainfrom
fix/webkit-reload-storm-store
Nov 17, 2026
Merged

arrzdev merged 1 commit into
mainfrom
fix/webkit-reload-storm-store

Conversation

@arrzdev

@arrzdev arrzdev commented Nov 17, 2026

Copy link
Copy Markdown
Owner

e2e/stress-tasks.spec.ts "five reloads in a row lose nothing and hydrate clean" failed once on WebKit in the weekly full matrix with Expected /50 pending/, received "0 pending • 0 archived". That reads as the store losing writes. It is not: WebKit's network process crashed during the storm.

What happens. Playwright's WebKit contexts are ephemeral, so IndexedDB lives in the network process's memory. Each reload in the storm cancels about a hundred in-flight dev-server module requests. On a loaded machine the Linux WebKit build's network process then logs GLib refcount assertions (g_atomic_ref_count_dec: assertion 'old_value > 0', g_atomic_rc_box_release_full: assertion 'real_box->magic == G_BOX_MAGIC') and aborts with glibc's corrupted double-linked list. The web process reports WebKit encountered an internal error. This is a WebKit bug. (WebLoaderStrategy::internallyFailedLoadTimerFired) and fails every in-flight load. The browser starts a new network process with empty storage, so the next document reads an empty store. The writes had committed: each one waits for the IndexedDB transaction's complete, and the list showed 50 before the storm. Killing the network process by hand in the middle of a reload gives the same page and the same failed-load text.

What changes. No app or framework change; there is no data loss to fix. The storm test's two count checks now carry a message from e2e/support/browser-crash.ts. When a load failed with "WebKit encountered an internal error", or the HMR socket reported "Network process crashed", the failure says the network process crashed and should be read as a browser crash. The test still fails then; re-running is a human decision.

Reproduce:

cd playground
# with another WebKit suite running on the machine at the same time
DEBUG=pw:browser pnpm test:e2e:stress e2e/stress-tasks.spec.ts -g "five reloads" --project=webkit --repeat-each=10

Verify:

  • CI failure: the trace shows 50 pending before the storm, an ~8 s stall on the 4th reload, three loads failing with "WebKit encountered an internal error", then the plain empty list (not the loading skeleton, not the error state).
  • Local, idle machine, before this change: --repeat-each=10 → 10 passed.
  • Local, with another WebKit suite running: 1 to 3 of 10 fail, each with the GLib assertion and corrupted double-linked list on the browser's stderr. After this change, 9 passed and 1 failed, with: Error: the storm lost tasks — but WebKit's network process crashed during the test (WebKit encountered an internal error (http://localhost:58791/manifest.json)), which empties an ephemeral context's storage: read this as a browser crash, not as the app losing writes.
  • Probe (not committed): SIGKILL of WPENetworkProcess mid-reload → in-flight loads fail with "WebKit encountered an internal error", HMR socket "Network process crashed", page shows 0 pending • 0 archived.
  • biome check e2e/, tsc --build (playground) clean.

Tested on: Linux, Playwright 1.61.1 WebKit (WPE), local stress config.
Not tested: macOS WebKit; Safari (its network stack is not GLib's and its IndexedDB is on disk).

… instead of reading it as lost tasks

Playwright's WebKit contexts keep IndexedDB in the network process's
memory. When the Linux build's network process aborts on heap corruption
during the reload storm, the next document reads an empty store and the
spec failed with "0 pending", the symptom of lost writes. The count
checks now say when the network process crashed during the test.
@arrzdev
arrzdev marked this pull request as ready for review November 17, 2026 05:48
@arrzdev
arrzdev merged commit e94a8dc into main Nov 17, 2026
4 checks passed
@arrzdev
arrzdev deleted the fix/webkit-reload-storm-store branch November 17, 2026 05:51
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