Skip to content

Sdk 6280 orphan fix#2

Merged
xxshubhamxx merged 2 commits into
release_3.11.1from
SDK-6280-orphan-fix
Jun 12, 2026
Merged

Sdk 6280 orphan fix#2
xxshubhamxx merged 2 commits into
release_3.11.1from
SDK-6280-orphan-fix

Conversation

@xxshubhamxx

Copy link
Copy Markdown
Owner

Original PR: nightwatchjs#56

xxshubhamxx and others added 2 commits June 10, 2026 01:29
…and sweep open entities at teardown

Key the cucumber _tests map by the unique testCaseStartedId instead of the
non-unique testCaseId, so reruns/retries/parallel-interleaved attempts of the
same scenario no longer clobber each other and every attempt emits its own
TestRunFinished. Harden TestCaseFinished to reconstruct a minimal payload and
still emit a terminal finish when the map entry is missing.

Add a teardown sweep (run before queue drain / build stop in both the main and
worker teardown paths) that emits terminal failed finishes for any scenario,
hook, or native run left open, so nothing is left running to be reaped as a
timeout. Make getCucumberHookType always return a known hook_type, and let
TestMap.getUUID fall back to the most recent unfinished run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…p fresh-uuid reconstruct

A duplicate/out-of-order TestCaseFinished for the same attempt used to find the
entry already deleted, hit the reconstruct branch, mint a fresh uuid, and emit a
phantom TestRunFinished for a run the backend never saw started. And the
reconstruct branch was dead code for the genuine start-never-recorded orphan: the
unguarded _testCasesData read threw before it ran (and the reconstruct itself threw
on undefined), all silently swallowed.

Track handled attempt ids in a Set and early-return on a duplicate finish, guard
the _testCasesData read so an unknown finish no-ops cleanly, and remove the
fresh-uuid reconstruct branch entirely. True orphans (started, never finished) are
owned solely by the teardown sweep, which holds the real stored uuid. The Set is
per-process and bounded by attempt count (same bound as _testCasesData).

Also: per-hook try/catch in sweepOpenHooks so one bad upload no longer aborts the
remaining hook sweeps; fix the synthetic native finish lang to 'nightwatch'; and
document the single-open-run-per-process assumption behind the TestMap.getUUID
fallback. Add tests for the duplicate-finish and never-started-finish cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xxshubhamxx
xxshubhamxx merged commit 86e7eb2 into release_3.11.1 Jun 12, 2026
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