diff --git a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Tests/MTConnectSampleLagTests.cs b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Tests/MTConnectSampleLagTests.cs index 517a95de..15b4dbfc 100644 --- a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Tests/MTConnectSampleLagTests.cs +++ b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Tests/MTConnectSampleLagTests.cs @@ -130,8 +130,11 @@ public sealed class MTConnectSampleLagTests try { // The NEXT enumeration (the raised one) is refused the way a real Agent refuses a count above its buffer. + // Enqueued only once the first stream has consumed a chunk — i.e. is past its own one-shot-failure check — + // so the failure can only ever hit the raised stream (enqueueing earlier raced the first enumeration). + await client.PumpAsync(Chunk(Primed, 2, last: 900)).WaitAsync(Watchdog, Ct); client.SampleFailures.Enqueue(new InvalidDataException("MTConnectError: INVALID_REQUEST count too large")); - for (var i = 0; i < 3; i++) + for (var i = 1; i < 3; i++) await client.PumpAsync(Chunk(Primed + (2 * i), 2, last: 900)).WaitAsync(Watchdog, Ct); await client.WaitForSampleCallsAsync(3).WaitAsync(Watchdog, Ct);