From 1d5127cd4ff4c46d66d99f895f0bc7a8da14ec9a Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Mon, 30 Mar 2026 00:40:08 -0500 Subject: [PATCH] fix: structural tests find call site instead of method definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ExtractMethod('ForceCompleteProcessingAsync') matched the first occurrence in the file — a call site added in PR #449 — instead of the method definition. The extracted block was the caller's method, which doesn't contain INV-1 fields, timer cancellation, or the IsProcessing guard. Fix: use 'Task ForceCompleteProcessingAsync' as the search signature to match the method definition, not call sites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- PolyPilot.Tests/SessionStabilityTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PolyPilot.Tests/SessionStabilityTests.cs b/PolyPilot.Tests/SessionStabilityTests.cs index 1cafe847e..babaf81f8 100644 --- a/PolyPilot.Tests/SessionStabilityTests.cs +++ b/PolyPilot.Tests/SessionStabilityTests.cs @@ -77,7 +77,7 @@ public void IsOrphaned_IsVolatile() public void ForceCompleteProcessing_ClearsAllInv1Fields() { var source = File.ReadAllText(TestPaths.OrganizationCs); - var method = ExtractMethod(source, "ForceCompleteProcessingAsync"); + var method = ExtractMethod(source, "Task ForceCompleteProcessingAsync"); // Every INV-1 field must be cleared var requiredClears = new[] @@ -107,7 +107,7 @@ public void ForceCompleteProcessing_ClearsAllInv1Fields() public void ForceCompleteProcessing_CancelsTimersBeforeUiThreadWork() { var source = File.ReadAllText(TestPaths.OrganizationCs); - var method = ExtractMethod(source, "ForceCompleteProcessingAsync"); + var method = ExtractMethod(source, "Task ForceCompleteProcessingAsync"); // Timer cancellation must happen BEFORE InvokeOnUI (thread-safe operations first) var cancelIdx = method.IndexOf("CancelProcessingWatchdog", StringComparison.Ordinal); @@ -122,7 +122,7 @@ public void ForceCompleteProcessing_CancelsTimersBeforeUiThreadWork() public void ForceCompleteProcessing_SkipsIfNotProcessing() { var source = File.ReadAllText(TestPaths.OrganizationCs); - var method = ExtractMethod(source, "ForceCompleteProcessingAsync"); + var method = ExtractMethod(source, "Task ForceCompleteProcessingAsync"); // Must early-return if already not processing (idempotent) Assert.Contains("!state.Info.IsProcessing", method);