Browse Source

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%).
pull/3755/head
Siegfried Pammer 1 month ago
parent
commit
85cbddfdcc
  1. 5
      ILSpy.Tests/Docking/SingletonDocumentTabTests.cs

5
ILSpy.Tests/Docking/SingletonDocumentTabTests.cs

@ -90,7 +90,10 @@ public class SingletonDocumentTabTests @@ -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");

Loading…
Cancel
Save