[Known Build Error] AutoLoadProjectsTests.RestoresSolutionInsteadOfIndividualProjectsWhenSolutionLoaded -- "Restoring App.csproj" instead of "Restoring App.sln"
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1587906 Leg Name: Test_Linux_Debug (attempt 1) Build error leg or test failing: Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests.Workspaces.AutoLoadProjectsTests.RestoresSolutionInsteadOfIndividualProjectsWhenSolutionLoaded Pull request: https://github.com/dotnet/roslyn/pull/85028
Error Message
Matching configuration for Build Analysis Known Issues. The strings match the assertion and this test's stack frame in order. Automatic build retries are not enabled by this tracking update.
{
"ErrorMessage": [
"Assert.Equal() Failure: Strings differ",
"Expected: \"Restoring App.sln\"",
"Actual: \"Restoring App.csproj\"",
"at Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests.Workspaces.AutoLoadProjectsTests.RestoresSolutionInsteadOfIndividualProjectsWhenSolutionLoaded()"
],
"BuildRetry": false,
"ExcludeConsoleLog": false
}Summary
Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests.Workspaces.AutoLoadProjectsTests.RestoresSolutionInsteadOfIndividualProjectsWhenSolutionLoaded failed intermittently on Linux Debug CI. In plain terms: the test loads a solution containing two unrestored projects and expects a single restore of the whole solution (Restoring App.sln). Instead, only one project (App.csproj) was restored on its own (Restoring App.csproj), and that restore actually succeeded -- this isn't a broken restore, it's the "restore only what's needed" logic kicking in on just one project before the second project had been queued.
Failure details
- Build: 1587906 (roslyn-CI, branch
refs/pull/85028/merge, PR #85028) - Failed step (attempt 1): Test / Test_Linux_Debug
- Test result: run 43825534, result 248620
- The same build's stage attempt 2 (job
Test_Linux_Debug) passed on retry, including this test's assembly.
Assert.Equal() Failure: Strings differ
v (pos 14)
Expected: "Restoring App.sln"
Actual: "Restoring App.csproj"
^ (pos 14)
at Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests.Workspaces.AutoLoadProjectsTests.RestoresSolutionInsteadOfIndividualProjectsWhenSolutionLoaded() in /_/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests/Workspaces/AutoLoadProjectsTests.cs:line 161The retained xUnit diagnostic log for the failed attempt (xUnitFailure-Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests_36.log) shows:
App.slnwas found and auto-loaded.- Only
App.csprojwas loaded/reloaded ("Completed (re)load of 1 project(s)") before the restore kicked off. dotnet restoreran againstApp.csprojalone and completed successfully.Nested.csprojnever appears as loaded in the log before the test tore down the server.
Root cause candidates (unconfirmed -- need to pick between these)
Product timing issue:
App.csprojandNested.csprojare queued into the project loader'sAsyncBatchingWorkQueue(100ms batch window, seeLanguageServerProjectLoader.cs) sequentially as the solution is opened. If the first batch fires before the second project's load is enqueued,GetPathsToRestoreAsync(LanguageServerProjectSystem.cs) sees only one project needing restore and -- per the singleton-restore optimization added in commit6ab5e880562ec35a626d9c7690566fe10244f232("Don't restore the entire solution if we still have only one project") -- restores that project individually instead of waiting to coalesce with the rest of the solution. If both projects loading into the same batch is supposed to be a reliable guarantee once a solution is open, this is a genuine race in project enqueueing/batching that should be fixed in the product.Test assumption is too strict: the singleton-restore optimization is intentional (added deliberately, not accidentally), and it may be entirely acceptable/expected for the two projects to sometimes load in separate batches under CI-level scheduling variance. In that case the test itself is asserting something the product never actually guarantees, and the fix belongs in the test (e.g., wait for solution load to fully settle before asserting, or tolerate a per-project restore for projects that load before the rest of the solution).
Suggested next step
Instrument (or otherwise determine) exactly when App.csproj and Nested.csproj are each enqueued relative to the loader's 100ms batching window during OpenSolutionAsync. That will show whether this is a genuine ordering race the product should guard against, or an expected multi-batch scenario that the test needs to tolerate.
This was filed based on triage of a single observed CI failure; recurrence/frequency has not yet been separately measured.
Known issue validation
Build: :mag_right: Result validation: :warning: Validation could not be done without an Azure DevOps build URL on the issue. Please add it to the "Build: :mag_right:" line. Validation performed at: 9/21/2026 7:09:59 PM UTC
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 0 | 0 |
Source: dotnet/roslyn