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
The screenshot suites are supposed to fail when fewer screenshots are
produced than there are stored goldens. #5135 reworked that floor into a
check that only counts "missing_actual" entries among the screenshots
the harness actually delivered -- so a test that silently drops out
(hang, crash, lost transport frame) leaves no record behind to count,
and the suite passes green with a shrunken capture set.
Real master runs show the hole: the JS suite passed at 118/120 goldens,
and mac-native passed runs that delivered as few as 29 or 58 of 124
(its delivered count swings 29/58/79/128 run to run -- a non-determi-
nistic hang the old guard rewarded, since truncating early means fewer
chances to diff).
Restore the documented behaviour: anchor the count on the reference
(golden) directory, which is the manifest. expected = #goldens,
covered = goldens rendered AND compared (status equal|different), and
the suite fails when expected - covered exceeds CN1SS_ALLOWED_MISSING.
A dropped test is now always visible as an uncovered golden regardless
of whether the harness recorded it. Also:
- implement CN1SS_MIN_SCREENSHOTS (referenced in comments, never coded)
to raise the floor above the on-disk golden count while seeding.
- make CN1SS_SKIP_COUNT_CHECK=1 (the sole bypass, for seeding new
reference sets) log loudly so it can't be mistaken for normal runs.
- close the JS harness exit-0 hole: reaching SUITE:FINISHED with zero
delivered screenshots now fails when goldens are expected, instead of
being treated as a clean no-screenshot run.
This guard is coverage-critical and must not be weakened or removed.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cn1ss_log "WARNING: CN1SS_SKIP_COUNT_CHECK=1 -- screenshot count-regression guard BYPASSED. This must only be used while intentionally seeding a new reference set."
482
+
else
483
+
local expected_count covered_count uncovered_count allowed_missing min_floor
if [ "$uncovered_count"-gt"$allowed_missing" ];then
498
+
cn1ss_log "FATAL: $uncovered_count of $expected_count expected screenshot(s) were not produced and compared (only $covered_count covered); $allowed_missing tolerated (CN1SS_ALLOWED_MISSING)."
499
+
cn1ss_log " A test failed to emit its screenshot, or the suite hung/crashed before finishing. The golden set under the comparison directory is the source of truth for how many screenshots must be produced."
if [ "$expected_goldens"-le"$allowed_missing" ];then
124
+
rj_log "No screenshots delivered over WebSocket but reached SUITE:FINISHED; $expected_goldens expected (<= $allowed_missing tolerated) -- treating as a no-screenshot run"
125
+
exit 0
126
+
fi
127
+
rj_log "FATAL: reached SUITE:FINISHED but delivered 0 of $expected_goldens expected screenshot(s) ($allowed_missing tolerated) -- the suite dropped every screenshot (hang/crash)."
128
+
exit 17
108
129
fi
109
130
rj_log "STAGE:MARKERS_NOT_FOUND -> no WebSocket screenshots and no SUITE:FINISHED in browser log"
0 commit comments