Two alarm-ack tests assert an absence with AwaitAssert, so they pass instantly and prove nothing #501
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while root-causing #500. Not a flake - these always pass; the problem is that they pass without testing anything.
DriverHostActorNativeAlarmAckRoutingTests.cs:90and:116:AwaitAssertpolls and returns on the first success.recorder.Acksis empty at t=0, so the very first poll succeeds and the call returns immediately - the 800 ms is never spent. The comment says "give the handler time to run", but no time is given at all.Consequence: if the routing regressed and an ack were produced for an unmapped node (or on a Secondary), these tests would still very likely pass, because the assertion is evaluated before the fire-and-forget handler has had any chance to run.
AwaitAssertis the right tool for a presence assertion (wait until X becomes true) and the wrong tool for an absence one (confirm X never becomes true). The absence form needs settle-then-assert:DriverHostActorUnreadableArtifactTestsalready does this correctly and documents why its settle window is calibrated against a positive control - that is the pattern to copy.Note before fixing: changing these may turn them red. If it does, that is a genuine defect being surfaced, not a test regression, so it wants doing deliberately rather than folded into an unrelated change.
Checked and NOT affected:
PeerProbeSupervisorTests'sChildCount.ShouldBe(0)waits are each preceded by aShouldBe(1), so they assert a real transition rather than the initial state.