You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop session stack pollution on repeated teardown starts - #5771
Fixes #5769.
In run-workers --by pool, a Before hook failing after loginAs() left the 'teardown' recorder session unbalanced. Every subsequent failure re-started it, pushing stale promises onto the shared session stack (oldPromises), until session.restore() chained a promise onto itself — "Chaining cycle detected" rejections grew exponentially and the worker died of OOM with OK | 0 passed
Thanks! Works for the #5769 repro. But with retry: { Before: 1 } in the config (we use { Scenario: 1, Before: 1 }) it still breaks in --by pool: the failed Before error keeps coming back as UNHANDLED REJECTION (16 → 1,957 → 133K …), the worker runs out of memory, and the summary says OK | 0 passed.
1 [Worker 01] Suite 10 --
16 [Worker 1] UNHANDLED REJECTION: element (#missing) still not present on page after 1 sec
…
1 [Worker 01] Suite 07 --
1957 [Worker 1] UNHANDLED REJECTION: element (#missing) still not present on page after 1 sec
…
1 [Worker 01] Suite 04 --
133505 [Worker 1] UNHANDLED REJECTION: element (#missing) still not present on page after 1 sec
…
1 [Worker 01] FAIL | 11 passed, 11 failed, 6 failedHooks // 2s
…
1 [Main] Worker Error: Error [ERR_WORKER_OUT_OF_MEMORY]: Worker terminated due to reaching memory limit: JS heap out of memory
1 OK | 0 passed // 59s
👷♀️ Is it done
Partially. Prevent worker crashes after authenticated setup failures.
The added cleanup is skipped with retry: { Before: 1 }, leaving the reported retry case unaddressed. This is a static review; scenarios were not executed.
🦕 Backwards Compatibility
Existing configurations remain valid, but nested execution scopes are affected by the regression below.
🌋 Merge Risks
Nested scopes restore the wrong parent — authors nesting within blocks lose the outer execution boundary in lib/recorder.js.
🔬 What must be verified
What if a QA engineer retries failing authenticated setup once — retry completes; remaining pooled tests execute; failures are reported.
What if a QA engineer runs repeated authenticated setup failures — all suites execute without memory exhaustion or false success.
What if a QA engineer’s saved login expires during setup — authentication recovers; subsequent failures remain isolated.
This branch has not been deployed
No deployments
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
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.
Summary
Fixes #5769.
In
run-workers --by pool, aBeforehook failing afterloginAs()left the'teardown'recorder session unbalanced. Every subsequent failure re-started it, pushing stale promises onto the shared session stack (oldPromises), untilsession.restore()chained a promise onto itself — "Chaining cycle detected" rejections grew exponentially and the worker died of OOM withOK | 0 passed