Repository navigation
Description
Harness.Skip emits a TAP line beginning ok . SelfTestBatch's parser branches on that prefix and sets sawChecksForCurrent = true — the flag that exists specifically to catch a fixture which asserted nothing. So a fixture that skips every check it owns is reported PASSED, with zero not ok lines and a # Total failures: 0 trailer.
The fixture and the parser are each individually correct. The defect is that the TAP stream carries the distinction and the consumer discards it.
Mechanism
Harness.cs:197-200 Skip(name, reason) => Console.WriteLine($"ok {name} # SKIP {reason}"); // no _failures++
docstring :191-196 "without counting it as a pass OR a failure"
SelfTestBatch.cs:268 else if (line.StartsWith("# Total failures:")) // checked FIRST; a SKIP line is not '#'
SelfTestBatch.cs:272 else if (line.StartsWith("ok ")) { sawChecksForCurrent = true; } // <-- SKIP LANDS HERE
SelfTestBatch.cs:274 // "Harness-level pass; ignore payload, just note that current saw checks."
SelfTestBatch.cs:250 var passed = failuresForCurrent.Count == 0 && sawChecksForCurrent;
SelfTestBatch.cs:252 // sawChecksForCurrent exists to produce "fixture emitted no TAP checks"
Measured:
'ok X # SKIP reason'.StartsWith("ok ") = True
'ok X # SKIP reason'.StartsWith("not ok ") = False
=> passed = (0 failures) && (sawChecks true) = TRUE
occurrences of "SKIP": Harness.cs 1 (the emission site)
SelfTestBatch.cs 0 <-- the parser never looks for it
SelfTestRunner.cs 3 <-- unrelated (AOT/filter path, see #1055)
The parser's own comment states it: "ignore payload" — and # SKIP is the payload.
Two anti-vacuity mechanisms cancel each other. Harness.Skip exists to say "I could not assert this"; sawChecksForCurrent exists to ask "did you assert anything?" The first satisfies the second.
The purest instance is CenterOnCurrent_UsesCursorMonitor
Census over all 188 files in tests/Reactor.AppTests.Host/SelfTest/Fixtures/: 15 H.Skip sites, and they are not one shape.
| site | shape | effect when the skip is taken |
|---|---|---|
Phase1WindowingFixtures.cs:267 CenterOnCurrent_UsesCursorMonitor |
if/else skip-or-check; the fixture's only check |
PASSED, asserting nothing |
Phase4WindowingFixtures.cs:161 CornerStyle_Apply |
skip + return; only check; OS-version gate |
PASSED, asserting nothing (Windows 10) |
Phase3WindowingFixtures.cs:199 PersistPlacement_FallbackWhenEmpty |
if/else; one sibling check survives at :221 |
PASSED on 1 of 2 checks |
DataGridEditFixtures.cs:888 / :1168 / :1285 |
skip + return; one real check above |
PASSED on ~1 of 27 checks |
NativeDockingA11yFixture.cs:278-283 |
H.Check(precondition) then skip + return |
correct idiom — goes red |
ControlledOptionalSelfTestHelpers.cs:204 |
returns from a per-scenario helper, not the fixture | benign |
| 7 others | one deferred check among many | the docstring's intended use |
CenterOnCurrent_UsesCursorMonitor is the sharp one, and it is the fixture AGENTS.md holds up as the model remediation:
"Fixed by skipping rather than asserting when the cursor is undeterminable."
It has exactly one check name, emitted either as H.Skip or as H.Check. On the non-interactive sessions AGENTS.md documents as a 100% deterministic failure, not a flake (GetCursorPos → ACCESS_DENIED), its only TAP line is ok CenterOnCurrent_UsesCursorMonitor # SKIP …, and the fixture reports PASSED having verified nothing. The remediation is right; its interaction with the reporting layer is what is not.
NativeDockingA11yFixture.cs:278-283 is the in-repo exemplar of the shape that works — an H.Check on the precondition (which can emit not ok) before the H.Skip + return.
Not a duplicate of #1033 or #1055
Both are adjacent and neither covers this.
- Selftest:
Issue717_PinReleasedAfterRecoverycannot detect "the pin never engaged", andIssue717_Collapse_Pinned*go vacuously green when their control fails #1033 is theH.Check-is-non-halting family, and it bounds its own severity explicitly: "The run does go red (the control and two others fail), so CI is not blind — but the wrong checks reportok." This case breaks that bound — zeronot ok,passed = true,# Total failures: 0. Selftest:Issue717_PinReleasedAfterRecoverycannot detect "the pin never engaged", andIssue717_Collapse_Pinned*go vacuously green when their control fails #1033's prescribed remedy isH.Check(...)+if (!engaged) return;, which reddens;H.Skip(...)+returndoes not. - [Testing] The two-place fixture rule can't be verified by the fast loop AGENTS.md recommends — --filter and AOT skip both bypass the "fixture not found" detector #1055 quotes the identical
ok … # SKIPemission line, but traces it to a different consumer — theCreate()"fixture not found" detector atSelfTestRunner.cs:296-301— and its subject is registration. It never reachesSelfTestBatch.cs:250orsawChecksForCurrent.
The obvious fix is wrong
"Don't set sawChecksForCurrent for a skip line" yields passed = false, so CenterOnCurrent_UsesCursorMonitor and CornerStyle_Apply would fail on exactly the machines their skip was introduced to accommodate — re-creating the regression the skip fixed.
A third state is genuinely needed, and there is no room for one today:
SelfTestBatch.cs:25
private static readonly ConcurrentDictionary<string, (bool Passed, string Detail)> _byFixture = new();Sketch, in increasing order of change:
- Track skipped check names per fixture (parse the
# SKIPsuffix rather than discarding it). - Widen the tuple to a three-state outcome so a fixture whose checks were all skipped reports
SKIPPEDwith the reasons attached, distinct from bothPASSEDandFAILED. - Optionally surface a run-level count, so
# Total failures: 0alongside "N fixtures fully skipped" is legible rather than silently reassuring.
Whatever the shape, the acceptance test is that a fixture emitting only skip lines must not be indistinguishable from one that ran and passed.
Why this is worth a separate issue
A skipped selftest is not, by itself, a problem — the skip exists so an unobservable precondition does not produce a vacuous assertion, and that judgement is correct. The problem is that the verdict the batch reports is identical in the healthy and the fully-degraded case, so no consumer downstream — CI, a coverage run, or a contributor reading # Total failures: 0 — can tell them apart. That is the same asymmetry AGENTS.md §Checks that actually prove something describes: the loud direction is a failure someone investigates, the silent direction is a green run nobody does.
Activity
Merge origin/main into the skip-verdict branch
Fail a fixture that emits no check and no skip, on the Host side too
Report a fully-skipped selftest fixture as SKIPPED, not PASSED (#1104)
Fix AOT Selftests: EventSource is inert under NativeAOT
Report unresolved ApplyStyle keys; add Display() and TitleLarge() (#1118
Drop the #1148 references from code and the manifest