Runtime.Tests GrpcDataConfiguredDiscoveryWireTests is flaky (~1 in 4 runs of the class) #920

Closed
opened 2026-11-23 22:08:20 -05:00 by dohertj2 · 2 comments
Owner

Observed 2026-11-23 on master 0c86edc1 (macOS, Release, dotnet test tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests --filter FullyQualifiedName~GrpcDataConfiguredDiscoveryWireTests, 86 tests, ~1.5 min):

  • Bad_null_sdk_notification_cannot_borrow_unproven_sample_evidence(scenario: "different_timestamp") failed 2 of 8 runs (and 1 of 6 in an earlier batch; name not captured there).
  • On the H2 branch, Failed_sdk_item_construction_releases_candidate_and_fanout_ownership (partial file GrpcDataSdkSourceLossTests.cs) failed ~1 in 3 runs of the class (a retained-entry count was 1, expected 0); passes alone. Not seen on master in 14 runs — being checked on the H2 branch.

Both pass in isolation, so this looks like cross-test state or timing inside the partial class (shared node manager / projected-sample caches read by reflection). Phase gate P11Wire includes these tests.

Do: find the shared state or race, fix it (no timeout widening, no skips), prove with 30 consecutive class runs.

Observed 2026-11-23 on master `0c86edc1` (macOS, Release, `dotnet test tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests --filter FullyQualifiedName~GrpcDataConfiguredDiscoveryWireTests`, 86 tests, ~1.5 min): - `Bad_null_sdk_notification_cannot_borrow_unproven_sample_evidence(scenario: "different_timestamp")` failed 2 of 8 runs (and 1 of 6 in an earlier batch; name not captured there). - On the H2 branch, `Failed_sdk_item_construction_releases_candidate_and_fanout_ownership` (partial file `GrpcDataSdkSourceLossTests.cs`) failed ~1 in 3 runs of the class (a retained-entry count was 1, expected 0); passes alone. Not seen on master in 14 runs — being checked on the H2 branch. Both pass in isolation, so this looks like cross-test state or timing inside the partial class (shared node manager / projected-sample caches read by reflection). Phase gate P11Wire includes these tests. Do: find the shared state or race, fix it (no timeout widening, no skips), prove with 30 consecutive class runs.
dohertj2 added the type:bugtype:testpriority:p2 labels 2026-11-23 22:08:20 -05:00
Author
Owner

More data from the H2 branch (10 runs of the class): Failed_sdk_item_construction_releases_candidate_and_fanout_ownership 2/10, New_primary_renews_same_monitored_item_after_a_prior_mapped_read(warmByRead: True) 1/10, Two_sdk_cadences_renew_before_expiry_without_reviving_old_notification_evidence 1/10; 6/10 clean. Master: 3/14 runs failed (names captured for two: Bad_null_sdk_notification_cannot_borrow_unproven_sample_evidence(different_timestamp)). Several different tests in the same partial class flake on both branches. Analysis of Failed_sdk_item_construction… (H2 agent): it compares a shared candidate-budget count before and after a failed second item while the first item is still live; a candidate the live item briefly holds between sampling ticks can make the second read 1 instead of 0 — a self-race in the test.

More data from the H2 branch (10 runs of the class): `Failed_sdk_item_construction_releases_candidate_and_fanout_ownership` 2/10, `New_primary_renews_same_monitored_item_after_a_prior_mapped_read(warmByRead: True)` 1/10, `Two_sdk_cadences_renew_before_expiry_without_reviving_old_notification_evidence` 1/10; 6/10 clean. Master: 3/14 runs failed (names captured for two: `Bad_null_sdk_notification_cannot_borrow_unproven_sample_evidence(different_timestamp)`). Several different tests in the same partial class flake on both branches. Analysis of `Failed_sdk_item_construction…` (H2 agent): it compares a shared candidate-budget count before and after a failed second item while the first item is still live; a candidate the live item briefly holds between sampling ticks can make the second read 1 instead of 0 — a self-race in the test.
Author
Owner

Fixed on master 4ac83085. Root causes: (1) PRODUCTION — a demand disposed mid-publish made HasFreshCachedLocked read 'not fresh' and republish a complete baseline, leaving a never-consumed proof candidate (the retained entry); fixed + deterministic regression test; (2) test race — SDK 2.0.1 async delivery could land the published sample after the mode cycle. Class: 5/16 failing before, 30/30 after. Evidence docs/plans/evidence/grpc-data-ext/920.md.

Fixed on master 4ac83085. Root causes: (1) PRODUCTION — a demand disposed mid-publish made HasFreshCachedLocked read 'not fresh' and republish a complete baseline, leaving a never-consumed proof candidate (the retained entry); fixed + deterministic regression test; (2) test race — SDK 2.0.1 async delivery could land the published sample after the mode cycle. Class: 5/16 failing before, 30/30 after. Evidence docs/plans/evidence/grpc-data-ext/920.md.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#920