Repository navigation
test(acp): raise in-memory test hang-guard from 5s to 30s - #146
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mainwent red after #143:windows-latest / net8.0failed 2 of 1,930 tests withTimeoutException:AcpClientTests.FileSystemRequests_WithoutTheCapability_GetMethodNotFoundAcpClientTests.AgentDyingMidTurn_FailsTheTurn_AndEndsTheUpdateStreamBoth 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
FakeAgentPeerread,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 byReadMessageAsync,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 greenwindows-latest / net8.0across a few CI runs.