Skip to content

fix: structural tests find call site instead of method definition#453

Merged
PureWeen merged 1 commit intomainfrom
fix/ci-stability-tests
Mar 30, 2026
Merged

fix: structural tests find call site instead of method definition#453
PureWeen merged 1 commit intomainfrom
fix/ci-stability-tests

Conversation

@PureWeen
Copy link
Copy Markdown
Owner

Problem

3 tests in SessionStabilityTests fail on CI (run):

  • ForceCompleteProcessing_ClearsAllInv1Fields
  • ForceCompleteProcessing_CancelsTimersBeforeUiThreadWork
  • ForceCompleteProcessing_SkipsIfNotProcessing

ExtractMethod(source, "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 body, which doesn't contain the INV-1 fields, timer cancellation, or IsProcessing guard the tests expect.

Fix

Use "Task ForceCompleteProcessingAsync" as the search signature so ExtractMethod matches the method definition, not call sites.

Verification

All 3,031 tests pass locally.

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>
@PureWeen
Copy link
Copy Markdown
Owner Author

🤖 Multi-Model Code Review — PR #453

fix: structural tests find call site instead of method definition
Reviewed by: Claude Opus 4.6, Claude Sonnet 4.6, GPT-5.3-Codex


Fix Correctness

All 3 models confirm: the fix is correct and non-regressive. "Task ForceCompleteProcessingAsync" matches the method definition (private async Task ForceCompleteProcessingAsync(...)) and does NOT match any call site (await ForceCompleteProcessingAsync(...)). The 3 failing tests will now reliably extract the correct method body.


Consensus Findings

🟡 MODERATE — RunProcessingWatchdogAsync has the same latent ambiguity (pre-existing)

Files: SessionStabilityTests.cs:62,274 + LongRunningSessionSafetyTests.cs:403
Models: Opus + Sonnet + Codex (3/3)

ExtractMethod(source, "RunProcessingWatchdogAsync") uses a bare method name, identical to the pattern this PR fixes. It works today only because the call site (_ = RunProcessingWatchdogAsync(...)) happens to sit near the definition — but if anyone adds another call site earlier in Events.cs, these tests will break the same way. Should be "Task RunProcessingWatchdogAsync" for consistency with this fix.

Note: This is pre-existing, not introduced by this PR. Flagging for awareness.

🟢 MINOR — Signature-change fragility

File: SessionStabilityTests.cs:80,110,125
Models: Sonnet + Codex (2/3)

"Task ForceCompleteProcessingAsync" would break if the return type changes to something other than Task/ValueTask. Acceptable fragility for structural tests, but worth noting.


CI Status

⚠️ No CI checks configured for the fix/ci-stability-tests branch.

Prior Review Comments

None — this is the first review.

Test Coverage

The PR fixes 3 existing tests. No new code paths requiring additional tests.


Recommended Action

Approve — Correct, minimal fix for CI test failures. The latent RunProcessingWatchdogAsync ambiguity is pre-existing and could be addressed in a follow-up.

@PureWeen PureWeen merged commit 1e6c344 into main Mar 30, 2026
@PureWeen PureWeen deleted the fix/ci-stability-tests branch March 30, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant