test(modbus): avoid un-awaited Shouldly Task assertion in #729 regression (#729)

This commit is contained in:
Joseph Doherty
2026-11-09 12:06:36 -05:00
parent 66867ca8f6
commit 2d6fd55477
@@ -138,7 +138,7 @@ public sealed class ModbusBackgroundLoopTokenLifetimeTests
gate.ArmedSchedules.ShouldBe(1, "exactly one task (the background loop) must be scheduled by initialize; anything else is ambiguous");
var probeTask = Field<Task>(drv, taskField);
probeTask.ShouldNotBeNull();
Assert.NotNull(probeTask); // not Shouldly: its Task overload would be an un-awaited async assertion
await gate.Started.Task.WaitAsync(Bound, TestContext.Current.CancellationToken);
probeTask.IsCompleted.ShouldBeFalse("the worker must be parked after its start check, before its delegate runs");