Fix 7 pre-existing test failures on Windows#213
Merged
Conversation
- DiffParser: TrimEnd('\r') after splitting on '\n' to handle CRLF line endings
- ServerManagerTests: Use '127.0.0.1' instead of 'localhost' to match IPv4-only TcpListener
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All production callers of CheckServerRunning used 'localhost' which can resolve to IPv6 (::1) on Windows while the copilot server binds IPv4. This caused the server to be incorrectly reported as not running, triggering spurious re-launches. Changed default parameter and all 5 call sites from 'localhost' to '127.0.0.1' to match the IPv4 loopback the server actually listens on. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Summary
Fixes 7 test failures that occur on Windows (all 1325 tests now pass).
Fix 1: DiffParser - CRLF line ending handling
DiffParser.Parse() splits on \n but did not strip trailing \r, causing all parsed content to have trailing \r on Windows.
Fix: Added .TrimEnd('\r') to the line variable (1 line change).
Fix 2: ServerManagerTests - IPv4/IPv6 mismatch
Test creates TcpListener(IPAddress.Loopback, 0) which binds IPv4 only, but connects via localhost which may resolve to IPv6 first on Windows, causing the 1s timeout.
Fix: Changed test to use 127.0.0.1 to match the IPv4-only listener (1 line, test-only).
Verification