Conversation
MainWindowViewModel fires the startup update check from its constructor. Every test session gets a fresh settings file, where the production default is "enabled, never checked", so each test that built the main window issued a real HTTPS request to the update feed. Errors are swallowed, so this never failed a test, but it is unmocked network traffic from a unit test, and offline each request holds a thread until the HttpClient timeout. Assisted-by: Claude:claude-fable-5-1:Claude Code
Every CLI test passed --disable-updatecheck by hand. That guard held only by convention: a new test that forgot the flag would silently query nuget.org at the end of its run, with the failure swallowed. Putting the flag into CliTestRunner makes it structural, and the per-test copies go away. Assisted-by: Claude:claude-fable-5-1:Claude Code
…cached Tester's static constructor resolved a FindPackageByIdResource for both feeds, which loads each feed's service index over HTTP before any cache is consulted. Offline, every decompiler test therefore died in the type initializer with "Unable to load the service index", even when all toolsets were already extracted and no download was needed. NuGet.Protocol offers no offline mode for this: the service index provider uses its own cache context with a 30-minute HTTP cache window and no stale-cache fallback. Resolving the resource at download time is the only way to avoid the request. The TestRunner build in the same setup hit the second feed-dependent step: NuGet audit during its implicit restore, which under warnings-as-errors turns an unreachable feed into NU1900 and fails the build. Downloads that are genuinely required still fail the suite when the network is unavailable, as intended. Assisted-by: Claude:claude-fable-5-1:Claude Code
siegfriedpammer
approved these changes
Oct 18, 2026
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.
A sweep of all test projects for network access found places where tests reach the Internet without needing to. The Roslyn toolset downloads in
ICSharpCode.Decompiler.Testsstay intentional: a package that is genuinely missing still fails the suite when it cannot be fetched.Headless UI tests (
ILSpy.Tests):MainWindowViewModel's constructor fires the startup update check. Each test session gets a fresh settings file, where the production default is "enabled, never checked", so every test that built the main window issued a real HTTPS request to the update feed. Errors are swallowed, so it never failed a test, but it is unmocked network traffic, and offline each request holds a thread until theHttpClienttimeout. The test settings file is now seeded with automatic update checks off, through a sharedTestSettingsFilehelper used by bothTestAppandResetAppStateAttribute, and a test pins that default.CLI tests (
ICSharpCode.ILSpyCmd.Tests): every test passed--disable-updatecheckby hand. A new test that forgot it would silently query nuget.org at the end of its run.CliTestRunner.RunAsyncnow prepends the flag itself, and the per-test copies are gone.Decompiler test setup (
ICSharpCode.Decompiler.Tests): with every toolset already extracted, an offline run still failed inTester's type initializer withFatalProtocolException: Unable to load the service index. The toolset constructors resolvedFindPackageByIdResourceeagerly, which fetches each feed's service index before any cache is checked. NuGet.Protocol has no offline switch for that path (the service index provider builds its own cache context, 30-minute HTTP cache window, no stale-cache fallback), so the resource is now resolved insideFetchPackage, only when a download is actually needed. The TestRunner build in the same setup then failed on NuGet audit during its implicit restore (NU1900 under warnings-as-errors); that build now passes-p:NuGetAudit=false, the runner's packages being audited by the regular solution restore already. Verified by running a Pretty test with an unreachable proxy and an empty NuGet HTTP cache: it failed before and passes now, and deleting an extracted ref pack with the network available still downloads it through the new path.Everything else the sweep flagged is already mocked (
FakeNuGetFeedClient/FakeNuGetIconLoader), local-only (Unix domain sockets in the temp directory), or plain URL string handling.Assisted-by: Claude:claude-fable-5-1:Claude Code