mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-10 17:12:41 +02:00
Fixes flakiness in worker tests that create a Worker or SharedWorker with a missing script URL and only attach an error handler to it. Once the test callback returns, nothing keeps the worker rooted from JavaScript. If GC ran before the WebWorker process reported the script fetch failure, the Worker/WorkerAgentParent cycle could be collected and the error event never delivered, leaving the test hung until timeout. Hold startup-pending WorkerAgentParents from the outside EnvironmentSettingsObject and release that edge once the script load succeeds, fails, or the worker closes. The worker now survives long enough to deliver its first script-load result.