Commit 95dcab2
fix(tests): stagger iframe worker launch + richer import error
Reported: on production tko.io under Safari, one spec
occasionally fails with the opaque WebKit message
`Importing a module script failed.` — most often a spec that
imports a large chunk graph (e.g. `builds/reference/spec/
bindingGlobalsBehavior.js`, which imports the full reference
build). Chromium handles the same graph fine. The failure mode
is known across Astro, SvelteKit, Nuxt, Immich, and tracks
against upstream WebKit bug 242740.
Two changes:
1. **Stagger worker launch** in tests.astro. With pool=4 every
worker used to spawn its first iframe simultaneously, hitting
the same shared module-graph chunks concurrently — that's
what triggers the WebKit race. A 120ms per-worker offset
spaces the first-round fetches (360ms total head-start for
pool=4) and removes the contention without materially
slowing the run (still ~5.2s end-to-end; was ~5.4s).
2. **Richer error on failure** in tests-frame.html. Keep the
original dynamic `import()` (no retry) but in the catch,
re-fetch the spec URL with `cache: 'no-store'` and report
HTTP status, content-length, and content-type alongside the
original WebKit message in both the in-frame err div and
the `import-error` postMessage. Gives something actionable
when the failure does surface.1 parent 4e20972 commit 95dcab2
2 files changed
Lines changed: 44 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
67 | 92 | | |
68 | 93 | | |
69 | 94 | | |
70 | 95 | | |
71 | | - | |
| 96 | + | |
72 | 97 | | |
73 | 98 | | |
74 | 99 | | |
| |||
80 | 105 | | |
81 | 106 | | |
82 | 107 | | |
83 | | - | |
84 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
85 | 111 | | |
86 | 112 | | |
87 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
637 | 650 | | |
638 | 651 | | |
639 | 652 | | |
640 | 653 | | |
641 | 654 | | |
642 | 655 | | |
643 | | - | |
| 656 | + | |
644 | 657 | | |
645 | 658 | | |
646 | 659 | | |
| |||
0 commit comments