test flake: FocasStatusFlagsTests.An_authored_FIXED_Status_tag_reads_the_flag intermittently Bad #673

Closed
opened 2026-10-11 04:41:43 -04:00 by dohertj2 · 1 comment
Owner

FocasStatusFlagsTests.An_authored_FIXED_Status_tag_reads_the_flag is intermittent. It failed in 2 of 6 runs on 2026-10-11, at master ee67b637, with no FOCAS change in the batch:

Shouldly.ShouldAssertException : snap.StatusCode should be 0u but was 2147811328u
  at FocasStatusFlagsTests.An_authored_FIXED_Status_tag_reads_the_flag() FocasStatusFlagsTests.cs:line 88

2147811328 is 0x80050000, BadCommunicationError. The read sometimes lands before the fake's status is available, or races the probe. Reproduce with:

for i in 1 2 3 4 5 6; do dotnet test tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests; done

Check for an absence/presence race of the #500 kind: assert on first success, or wait for the first successful poll.

`FocasStatusFlagsTests.An_authored_FIXED_Status_tag_reads_the_flag` is intermittent. It failed in 2 of 6 runs on 2026-10-11, at master `ee67b637`, with no FOCAS change in the batch: ``` Shouldly.ShouldAssertException : snap.StatusCode should be 0u but was 2147811328u at FocasStatusFlagsTests.An_authored_FIXED_Status_tag_reads_the_flag() FocasStatusFlagsTests.cs:line 88 ``` `2147811328` is `0x80050000`, BadCommunicationError. The read sometimes lands before the fake's status is available, or races the probe. Reproduce with: ``` for i in 1 2 3 4 5 6; do dotnet test tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests; done ``` Check for an absence/presence race of the #500 kind: assert on first success, or wait for the first successful poll.
Author
Owner

Fixed in 7d75478f (merged to master).

Root cause: FocasDriver.FixedTreeLoopAsync published DeviceState.LastStatus before FixedTreeCache / LastFixedPollUtc, and the test waited on LastStatus alone — so an authored FIXED:Status/* read could run while LastFixedPollUtc was still null and return BadCommunicationError.

  • Driver: LastStatus is now published last, via Volatile.Write (backing field read with Volatile.Read), so observing it implies the cache and poll stamp are visible.
  • Test: FocasStatusFlagsTests waits on all three (LastFixedPollUtc, FixedTreeCache, LastStatus).

Full suite green on the final master.

Fixed in `7d75478f` (merged to master). Root cause: `FocasDriver.FixedTreeLoopAsync` published `DeviceState.LastStatus` before `FixedTreeCache` / `LastFixedPollUtc`, and the test waited on `LastStatus` alone — so an authored `FIXED:Status/*` read could run while `LastFixedPollUtc` was still null and return `BadCommunicationError`. - Driver: `LastStatus` is now published last, via `Volatile.Write` (backing field read with `Volatile.Read`), so observing it implies the cache and poll stamp are visible. - Test: `FocasStatusFlagsTests` waits on all three (`LastFixedPollUtc`, `FixedTreeCache`, `LastStatus`). Full suite green on the final master.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#673