Three independent bugs interacted to let a real failure-on-retry be
reported as a pass:
1. The runner's disambiguator stored the counter against the suffixed
identifier (after mutation) instead of the base key, so the counter
never advanced past 1 and every 3rd+ same-loc registration collided
on :(1).
2. The reporter had the same off-by-one when writing the state file.
3. The reporter only bumped its counter on `test:pass`, so any failing
test at a shared source location desynchronised the writer and
runner counters - on retry, the surviving failing sibling would
inherit a slot that in the previous attempt belonged to a different
(passing) sibling. Node matched by that slot, replaced `this.fn`
with a synthetic noop replay, and reported the failure as a pass.
Track the base identifier separately in the runner, bump the counter
against the base key in both the runner and the reporter, and bump the
reporter's counter on `test:fail` in addition to `test:pass`.
Fixes: https://github.com/nodejs/node/issues/63424
Signed-off-by: atlowChemi <chemi@atlow.co.il>
PR-URL: https://github.com/nodejs/node/pull/63431
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>