From 85cbddfdcc8d0005b6faf69738e4f467e5db04e9 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 5 Jun 2026 21:27:39 +0200 Subject: [PATCH] Scope the About-tab test to the singleton, not the welcome page Reopening_About_Reuses_The_Same_Tab matched any tab whose Title is "About", but two tabs can carry that title: the singleton menu-About (IsStaticContent: true, opened via OpenSingletonTab) and the transient boot welcome page (ShowWelcome, IsStaticContent: false, a non-static main-tab page shown when nothing is restored). The welcome page's presence races with boot, so when it lingered the test's .Single(IsAbout) saw two tabs and threw "Sequence contains more than one matching element" -- a ~50% order-dependent flake. The singleton is what the test means to verify, so match it precisely (IsStaticContent: true). OpenSingletonTab/CloseDockable reuse was always sound; this was purely an imprecise test predicate. Deterministic now (5/5 full-suite runs green; was ~50%). --- ILSpy.Tests/Docking/SingletonDocumentTabTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ILSpy.Tests/Docking/SingletonDocumentTabTests.cs b/ILSpy.Tests/Docking/SingletonDocumentTabTests.cs index 4903d9efd..30210c6e4 100644 --- a/ILSpy.Tests/Docking/SingletonDocumentTabTests.cs +++ b/ILSpy.Tests/Docking/SingletonDocumentTabTests.cs @@ -90,7 +90,10 @@ public class SingletonDocumentTabTests var dock = vm.DockWorkspace; TestCapture.Step("booted"); - bool IsAbout(ContentTabPage t) => t.Content is DecompilerTabPageModel { Title: var title } && title == Resources.About; + // Match the singleton menu-About tab specifically (IsStaticContent), NOT the transient boot + // "welcome" page, which also carries Title == About but is a non-static main-tab page. The + // welcome page's presence races with boot, so matching it too made this a ~50% flake. + bool IsAbout(ContentTabPage t) => t.Content is DecompilerTabPageModel { Title: var title, IsStaticContent: true } && title == Resources.About; Invoke(window, nameof(Resources._About)); TestCapture.Step("about-opened");