Skip to content

test(acp): raise in-memory test hang-guard from 5s to 30s - #146

Merged
DevMando merged 1 commit into
mainfrom
fix/acp-test-timeouts
Nov 17, 2026
Merged

DevMando merged 1 commit into
mainfrom
fix/acp-test-timeouts

Conversation

@DevMando

@DevMando DevMando commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Problem

main went red after #143: windows-latest / net8.0 failed 2 of 1,930 tests with TimeoutException:

  • AcpClientTests.FileSystemRequests_WithoutTheCapability_GetMethodNotFound
  • AcpClientTests.AgentDyingMidTurn_FailsTheTurn_AndEndsTheUpdateStream

Both timed out in FakeAgentPeer.ReadMessageAsync() during setup (handshake / session/new), not in the behaviour under test. The same code passed on the PR branch ~7 minutes earlier and on the other three matrix jobs.

Cause

A hard-coded 5s guard on every FakeAgentPeer read, Within() default and polling loop. On a loaded runner running the full suite in parallel, the first read can exceed it.

Fix

One constant, AcpTestKit.AcpTestTimeouts.Guard (30s), used by ReadMessageAsync, ReadRawLineAsync, Within() and the four polling loops. It only bounds a hung test; passing tests never wait on it. Tests that assert a timeout (e.g. SilentAgent_TimesOutTheHandshake) rely on the client's own short timeout and are unaffected.

Verification

dotnet test --filter MandoCode.Tests.Acp: 672/672 pass on net8.0 and net10.0 locally. The flake did not reproduce locally, so confirmation is a green windows-latest / net8.0 across a few CI runs.

The ACP tests used a hard-coded 5s guard for every FakeAgentPeer read,
Within() call and polling loop. On the loaded windows-latest/net8.0 runner
the first handshake read exceeded it, failing main after #143
(FileSystemRequests_WithoutTheCapability_GetMethodNotFound and
AgentDyingMidTurn_FailsTheTurn_AndEndsTheUpdateStream), while the same
code had passed on the PR branch minutes earlier.

Centralize the value in AcpTestTimeouts.Guard (30s). It only bounds a hung
test, so passing tests never wait on it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@DevMando
DevMando merged commit ef602c5 into main Nov 17, 2026
4 checks passed
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