From 673d40b09f73922304b35e26fce0b956f65dda81 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sat, 11 Jul 2026 14:02:18 +0900 Subject: [PATCH] test: close diagnostic dispatch gate before signaling --- .../PgmConnectDiagnosticTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/MBN_STOCK_WEBVIEW.Playout.Tests/PgmConnectDiagnosticTests.cs b/tests/MBN_STOCK_WEBVIEW.Playout.Tests/PgmConnectDiagnosticTests.cs index 86e635e..756ce51 100644 --- a/tests/MBN_STOCK_WEBVIEW.Playout.Tests/PgmConnectDiagnosticTests.cs +++ b/tests/MBN_STOCK_WEBVIEW.Playout.Tests/PgmConnectDiagnosticTests.cs @@ -400,13 +400,16 @@ public sealed class PgmConnectDiagnosticTests public bool TryPreventKtapConnect() { - PreventionAttempted.Set(); var previous = Interlocked.CompareExchange(ref _dispatchGate, 2, 0); if (previous == 1 && LastKtapConnectState == PlayoutKtapConnectState.NotAttempted) { LastKtapConnectState = PlayoutKtapConnectState.Attempted; } + // Publish the test synchronization point only after the dispatch gate + // is closed. Signalling first lets the blocked safety probe resume and + // race KTAP dispatch before this prevention attempt has taken effect. + PreventionAttempted.Set(); return previous == 0; }