diff --git a/ILSpy.Tests/Options/DisplaySettingsReactionTests.cs b/ILSpy.Tests/Options/DisplaySettingsReactionTests.cs index 5b09ca435..7646fb32e 100644 --- a/ILSpy.Tests/Options/DisplaySettingsReactionTests.cs +++ b/ILSpy.Tests/Options/DisplaySettingsReactionTests.cs @@ -59,9 +59,16 @@ public class DisplaySettingsReactionTests public async Task Toggling_A_Decompiler_Output_Setting_Re_Decompiles_The_Active_Tab() { var (_, vm) = await TestHarness.BootAsync(); + // Decompile a single small method rather than the whole Enumerable type: the full type + // takes >15 s in headless and times out WaitForDecompiledTextAsync under CI load. The + // re-decompile reaction under test fires on whatever the active tab shows, so one method + // exercises it just as well. var typeNode = vm.AssemblyTreeModel.FindNode( "System.Linq", "System.Linq", "System.Linq.Enumerable"); - vm.AssemblyTreeModel.SelectedItem = typeNode; + typeNode.IsExpanded = true; + var method = typeNode.Children.OfType() + .First(m => m.MethodDefinition.Name == "Empty"); + vm.AssemblyTreeModel.SelectNode(method); var tab = await vm.DockWorkspace.WaitForDecompiledTextAsync(); int decompileStarts = 0; diff --git a/ILSpy.Tests/Options/OptionsTabTests.cs b/ILSpy.Tests/Options/OptionsTabTests.cs index 98e451bee..5722fd809 100644 --- a/ILSpy.Tests/Options/OptionsTabTests.cs +++ b/ILSpy.Tests/Options/OptionsTabTests.cs @@ -309,10 +309,15 @@ public class OptionsTabTests // pull focus back to MainTab and yank the user off the Options page they are editing. var (_, vm) = await TestHarness.BootAsync(3); - // Show some decompiled content first, so there is a decompiler tab to refresh. + // Show some decompiled content first, so there is a decompiler tab to refresh. Use a single + // small method, not the whole Enumerable type: the full type takes >15 s in headless and + // times out WaitForDecompiledTextAsync under CI load. var typeNode = vm.AssemblyTreeModel.FindNode( "System.Linq", "System.Linq", "System.Linq.Enumerable"); - vm.AssemblyTreeModel.SelectNode(typeNode); + typeNode.IsExpanded = true; + var method = typeNode.Children.OfType() + .First(m => m.MethodDefinition.Name == "Empty"); + vm.AssemblyTreeModel.SelectNode(method); await vm.DockWorkspace.WaitForDecompiledTextAsync(); // Open Options and confirm it is the active document.