fix(grpc-data): a raised F5 diagnostic follows the pending set down after a late native transition
The A1 phase-run failure of A_native_transition_leaves_the_F5_pending_set was a real defect: when the 600 ms F5 window closed before the transition was processed (a loaded run), the diagnostic kept the count from when it was raised (2) although the node manager held the condition established (1). New deterministic test closes the window first; red before, green after.
This commit is contained in:
+22
-1
@@ -259,8 +259,29 @@ public sealed class NativeAlarmInitialStateSignalTests : NativeAlarmSignalTestBa
|
||||
rig.Driver.Raise(A).ShouldBeTrue();
|
||||
rig.Publish.FishForMessage<OpcUaPublishActor.AlarmStateUpdate>(u => u.AlarmNodeId == A, TimeSpan.FromSeconds(5), cancellationToken: Ct);
|
||||
|
||||
// Either order is legal: the transition can land before the F5 window closes (the diagnostic is raised with 1) or
|
||||
// after it (raised with 2, then lowered to 1). The diagnostic must end at the node manager's count either way.
|
||||
AwaitCondition(() => rig.Hub.Unsignalled.TryGetValue(DriverId, out var d) && d.Conditions == 1, TimeSpan.FromSeconds(5), Ct);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A2 review (the A1 phase-run failure): the F5 window closes BEFORE the transition arrives — what a loaded run
|
||||
/// does to the 600 ms window above. The raised diagnostic must follow the pending set down (it used to keep the
|
||||
/// count from when it was raised, so it claimed a condition the node manager already held established).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void A_native_transition_after_the_F5_window_closed_lowers_the_raised_diagnostic()
|
||||
{
|
||||
var rig = StartRig(DriverTypeNames.Galaxy, ["hi", "lo"], o => o.WithSignalTimeout(DriverTypeNames.Galaxy, TimeSpan.FromMilliseconds(200)));
|
||||
AwaitCondition(() => rig.Hub.Unsignalled.ContainsKey(DriverId), TimeSpan.FromSeconds(5), Ct);
|
||||
rig.Hub.Unsignalled[DriverId].Conditions.ShouldBe(1); // only B is still unknown
|
||||
rig.Hub.Unsignalled[DriverId].Conditions.ShouldBe(2);
|
||||
|
||||
rig.Driver.Raise(A).ShouldBeTrue();
|
||||
rig.Publish.FishForMessage<OpcUaPublishActor.AlarmStateUpdate>(u => u.AlarmNodeId == A, TimeSpan.FromSeconds(5), cancellationToken: Ct);
|
||||
AwaitCondition(() => rig.Hub.Unsignalled.TryGetValue(DriverId, out var d) && d.Conditions == 1, TimeSpan.FromSeconds(5), Ct);
|
||||
|
||||
rig.Driver.Raise(B).ShouldBeTrue(); // the last pending condition established ⇒ the diagnostic clears
|
||||
AwaitCondition(() => !rig.Hub.Unsignalled.ContainsKey(DriverId), TimeSpan.FromSeconds(5), Ct);
|
||||
}
|
||||
|
||||
/// <summary>Review nit — a signal from anything but the current child (a stopped incarnation, a stray sender) is
|
||||
|
||||
Reference in New Issue
Block a user