Open
Conversation
`DeterministicMvidWorks`, `NewMvidWorks`, and `RetainMvid` were running as part of `All.CommandLineTests` and as part of their own `IndividualTests`. The individual test is going to use the same sandbox location as the `All.CommandLineTests` run uses. This means that the two tests can conflict. Which I suspect explains why our CI randomly hit the error below. Given that trimming these tests twice is wasteful. Let's update the individual test to run `Check`, giving the individual test the same coverage as when the test was running in `All.CommandsLineTests`. Then lets move the tests into an `Individual` folder so that they are not picked up by `All.CommandsLineTests`. Other tests in `IndividualTests` are following this pattern. ``` 1) Failed : Mono.Linker.Tests.TestCases.All.CommandLine.Mvid.DeterministicMvidWorks [19:40:23.176 Information] System.UnauthorizedAccessException : Access to the path 'test.exe' is denied. at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel) at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) at Mono.Linker.Tests.Extensions.NPath.Delete(DeleteMode deleteMode) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 580 at Mono.Linker.Tests.Extensions.Extensions.Delete(IEnumerable`1 self) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 889 at Mono.Linker.Tests.Extensions.NPath.DeleteContents() in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 614 at Mono.Linker.Tests.TestCasesRunner.TestCaseSandbox..ctor(TestCase testCase, NPath rootTemporaryDirectory, String namePrefix) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Trimming.Tests.Shared\TestCaseSandbox.cs:line 45 at Mono.Linker.Tests.TestCasesRunner.TestRunner.Run(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Trimming.Tests.Shared\TestRunner.cs:line 35 at Mono.Linker.Tests.TestCases.All.Run(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\TestCases\TestSuites.cs:line 304 at Mono.Linker.Tests.TestCases.All.CommandLineTests(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\TestCases\TestSuites.cs:line 64 at InvokeStub_All.CommandLineTests(Object, Span`1) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 2) Failed : Mono.Linker.Tests.TestCases.All.CommandLine.Mvid.NewMvidWorks System.UnauthorizedAccessException : Access to the path 'test.exe' is denied. at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel) at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) at Mono.Linker.Tests.Extensions.NPath.Delete(DeleteMode deleteMode) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 580 at Mono.Linker.Tests.Extensions.Extensions.Delete(IEnumerable`1 self) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 889 at Mono.Linker.Tests.Extensions.NPath.DeleteContents() in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 614 at Mono.Linker.Tests.TestCasesRunner.TestCaseSandbox..ctor(TestCase testCase, NPath rootTemporaryDirectory, String namePrefix) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Trimming.Tests.Shared\TestCaseSandbox.cs:line 45 at Mono.Linker.Tests.TestCasesRunner.TestRunner.Run(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Trimming.Tests.Shared\TestRunner.cs:line 35 at Mono.Linker.Tests.TestCases.All.Run(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\TestCases\TestSuites.cs:line 304 at Mono.Linker.Tests.TestCases.All.CommandLineTests(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\TestCases\TestSuites.cs:line 64 at InvokeStub_All.CommandLineTests(Object, Span`1) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 3) Failed : Mono.Linker.Tests.TestCases.All.CommandLine.Mvid.RetainMvid System.UnauthorizedAccessException : Access to the path 'test.exe' is denied. at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel) at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) at Mono.Linker.Tests.Extensions.NPath.Delete(DeleteMode dele [19:40:23.177 Information] teMode) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 580 at Mono.Linker.Tests.Extensions.Extensions.Delete(IEnumerable`1 self) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 889 at Mono.Linker.Tests.Extensions.NPath.DeleteContents() in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\Extensions\NiceIO.cs:line 614 at Mono.Linker.Tests.TestCasesRunner.TestCaseSandbox..ctor(TestCase testCase, NPath rootTemporaryDirectory, String namePrefix) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Trimming.Tests.Shared\TestCaseSandbox.cs:line 45 at Mono.Linker.Tests.TestCasesRunner.TestRunner.Run(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Trimming.Tests.Shared\TestRunner.cs:line 35 at Mono.Linker.Tests.TestCases.All.Run(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\TestCases\TestSuites.cs:line 304 at Mono.Linker.Tests.TestCases.All.CommandLineTests(TestCase testCase) in C:\build\output\unity\il2cpp\external\runtime\src\tools\illink\test\Mono.Linker.Tests\TestCases\TestSuites.cs:line 64 at InvokeStub_All.CommandLineTests(Object, Span`1) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ```
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses intermittent CI failures caused by the same MVID-related test cases being executed in multiple test suites that share the same sandbox path, leading to file access conflicts on cleanup.
Changes:
- Updates the NUnit
IndividualTestsfor MVID cases to runResultChecker(Check(result)) so they retain the same validation coverage they previously got when run via the “All” suites. - Moves the MVID test cases into an
Individualnamespace/location so they are no longer picked up by theAll.CommandLineTestssuite discovery. - Regenerates the ILLink Roslyn analyzer test-suite mapping so these cases run under
CommandLine.Mvid.Individualinstead ofCommandLine.Mvid.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/tools/illink/test/Mono.Linker.Tests/TestCases/IndividualTests.cs | Adds Check(result) to the three MVID individual tests and introduces a helper Check method using ResultChecker. |
| src/tools/illink/test/Mono.Linker.Tests.Cases/CommandLine/Mvid/Individual/DeterministicMvidWorks.cs | Updates namespace to ...Mvid.Individual to match on-disk Individual placement and avoid suite discovery conflicts. |
| src/tools/illink/test/Mono.Linker.Tests.Cases/CommandLine/Mvid/Individual/NewMvidWorks.cs | Same namespace update to ...Mvid.Individual. |
| src/tools/illink/test/Mono.Linker.Tests.Cases/CommandLine/Mvid/Individual/RetainMvid.cs | Same namespace update to ...Mvid.Individual. |
| src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/.../CommandLine.MvidTests.g.cs | Removes the three MVID tests from the non-individual CommandLine.Mvid analyzer suite. |
| src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/.../CommandLine.Mvid.IndividualTests.g.cs | Adds a new analyzer suite mapping for CommandLine.Mvid.Individual containing the three MVID tests. |
This was referenced Mar 14, 2026
Open
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.
DeterministicMvidWorks,NewMvidWorks, andRetainMvidwere running as part ofAll.CommandLineTestsand as part of their ownIndividualTests.The individual test is going to use the same sandbox location as the
All.CommandLineTestsrun uses.This means that the two tests can conflict. Which I suspect explains why our CI randomly hit the error below.
Given that trimming these tests twice is wasteful. Let's update the individual test to run
Check, giving the individual test the same coverage as when the test was running inAll.CommandsLineTests. Then lets move the tests into anIndividualfolder so that they are not picked up byAll.CommandsLineTests. Other tests inIndividualTestsare following this pattern.