From 3f074dc4e7a74f5fe5e6232e016d435ba178f9f4 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 9 Nov 2026 15:07:41 -0500 Subject: [PATCH] test(historian): pass TestContext.Current.CancellationToken in the batched alarm-writer test (lmxopcua#746) The batched-alarm-history test came from the lane-H2 branch, which predates the xUnit1051 sweep on master (lmxopcua#725). Two no-token calls broke the Release build under TreatWarningsAsErrors after the rebase. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV --- .../AlarmWriterTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.SqlServer.IntegrationTests/AlarmWriterTests.cs b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.SqlServer.IntegrationTests/AlarmWriterTests.cs index f631be60..36f20352 100644 --- a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.SqlServer.IntegrationTests/AlarmWriterTests.cs +++ b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.SqlServer.IntegrationTests/AlarmWriterTests.cs @@ -101,10 +101,10 @@ public sealed class AlarmWriterTests(SqlHistorianFixture fx) r.Count.ShouldBe(401); r.ShouldAllBe(o => o == HistorianWriteOutcome.Ack); await using var c = new SqlConnection(fx.ConnectionString); - await c.OpenAsync(); + await c.OpenAsync(TestContext.Current.CancellationToken); await using var cmd = c.CreateCommand(); cmd.CommandText = $"SELECT COUNT(*) FROM [{s}].Event"; - Convert.ToInt32(await cmd.ExecuteScalarAsync()).ShouldBe(400); + Convert.ToInt32(await cmd.ExecuteScalarAsync(TestContext.Current.CancellationToken)).ShouldBe(400); } [Fact]