Repository navigation
Keep the Ctrl+A delete test at the four assemblies it opens - #4355
Open
christophwille wants to merge 1 commit into
Open
christophwille wants to merge 1 commit into
christophwille wants to merge 1 commit into
Conversation
Decompiling the sample from ILSpy.Tests.dll auto-loaded that assembly's whole reference closure, so the list held 214 rows and Ctrl+A selected all of them. The tab title became their joined names (about 12,000 characters), and the headless stub fonts took minutes to lay that out inside Avalonia's KeyPress helper, which does not return until the dispatcher queue is empty. The test's own timeouts never ran, and the shard of runuitests.ps1 that contains it never ended. Assisted-by: Claude:claude-fable-5-2:Claude Code
This branch has not been deployed
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.
SwitchListAndDeleteAllTests.Ctrl_A_Then_Delete_Drops_The_Selection_History_And_Tabnever finished on my machine, so the last shard ofrunuitests.ps1never ended.Root cause
The test decompiles a sample from
ILSpy.Tests.dllto build up history. That auto-loads the test assembly's whole reference closure, so the assembly list holds 214 top-level rows instead of 4 and Ctrl+A selects all of them.KeyPresshelper, which does not return until the dispatcher queue is empty. When a layout takes longer than the 80 ms spinner interval the queue never empties, and the test's own timeouts, which are only checked between pumps, never fire.This comes from process dumps of the hung test host and from a probe test, not only from reading the code.
Change
Test only, in
ILSpy.Tests/AssemblyList/SwitchListAndDeleteAllTests.cs:AutoLoadAssemblyReferencesbefore decompiling, so the list stays at the four assemblies it means to select.Verification
./runuitests.ps1on Windows: all four shards exit 0 in 108 s, 1,350 tests, 0 failed, 1 skipped.Why CI does not show it
CI goes through the same state and escapes it narrowly. A temporary probe test, run once on the Windows runner from a throwaway branch (since deleted), reported the same 214 assemblies and the same 12,220-character title as locally. The difference is the number of logical processors: 4 on the runner, 24 on my machine.
KeyPressreturnsDOTNET_PROCESSOR_COUNT=4madeKeyPressreturn in 1.7 s, in two runs. Turning server GC off alone, as the CI workflow does, changed nothing.KeyPressreturns it sends Delete, which removes everything, so on CI it passes in about 3 s.Not established: the full mechanism behind the processor count. One contributor is identified. On every failed font-fallback lookup Avalonia's
FontCollectionBase.TryGetCoveringMatchcallsConcurrentDictionary.Keys.ToArray(), which takes one lock per logical processor; that was the hot spot in four of four stack samples. But limiting the processor count made the layout only 1.3-1.6x faster locally, not the roughly 5x seen on CI.Left alone
Three things the test tripped over that this PR does not touch:
XmlDocLoader.LoadDocumentationcaches per module, so the whole 32 MB ref pack is re-indexed for each framework assembly that is decompiled (134 s of CPU in the hung run).runuitests.ps1has no per-shard timeout, so any future stuck test blocks it forever again.🤖 Generated with Claude Code