Fix Windows-only test failures: profile file-lock and firewall-prompting sockets#62
Merged
Xyntexx merged 2 commits intoJul 3, 2026
Conversation
The test opened a read handle (FileShare.Read) on OldProfile.json and, while that handle was still open inside the using block, called WriteAllText on the same path -- which deterministically failed with 'process cannot access the file'. Read the file fully into a string and close the handle before writing the stripped-down profile back. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The virtual steer and machine modules bound their listen sockets to IPAddress.Any (0.0.0.0), which makes Windows Defender Firewall prompt for network access on every test run. All virtual-module traffic is 127.0.0.1, so bind the listeners to IPAddress.Loopback instead -- loopback traffic bypasses the firewall entirely, no per-machine allow rule needed. The send-only GPS receiver is left as an unbound UdpClient: outbound UDP does not trigger the prompt, and eager binding would race the machine module for an ephemeral port in VirtualModuleHub. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Two Windows-only test-suite fixes. Both are test-side only; no product code changes.
1. File-lock failure in
Load_OlderProfileWithoutNewFields_KeepsModelDefaultsThe test opened a read handle (
FileShare.Read) onOldProfile.jsonand, while that handle was still open inside theusingblock, calledWriteAllTexton the same path. On Windows this deterministically fails with "process cannot access the file"; on Linux POSIX advisory locking lets the write through, which is why CI (ubuntu) never caught it. Read the file fully into a string and close the handle before writing back.2. Windows Firewall prompt on every test run
VirtualSteerModuleandVirtualMachineModulebound their listen sockets toIPAddress.Any(0.0.0.0), which makes Windows Defender Firewall prompt for network access. All virtual-module traffic is127.0.0.1, so bind the listeners toIPAddress.Loopbackinstead - loopback bypasses the firewall, no per-machine allow rule needed. The send-only GPS receiver is left as an unboundUdpClient(outbound UDP does not trigger the prompt, and eager binding would race the machine module for an ephemeral port inVirtualModuleHub).Testing
🤖 Generated with Claude Code