From b06a1850833d9569b10047b59e5d7f1a893e51e3 Mon Sep 17 00:00:00 2001 From: "Leaf Shi (BEYONDSOFT CONSULTING INC)" Date: Fri, 23 May 2025 17:07:56 +0800 Subject: [PATCH 1/3] Skip unstable ListView UI tests --- .../UIIntegrationTests/ListViewTests.cs | 63 ++++++++++++++++++- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/src/test/integration/UIIntegrationTests/ListViewTests.cs b/src/test/integration/UIIntegrationTests/ListViewTests.cs index d1cf67f095c..a12727ec962 100644 --- a/src/test/integration/UIIntegrationTests/ListViewTests.cs +++ b/src/test/integration/UIIntegrationTests/ListViewTests.cs @@ -11,8 +11,7 @@ namespace System.Windows.Forms.UITests; // NOTE: This class contains many tests which don't require user input. Although they arguably belong to the unit // tests project, these tests assert behaviors of ListView.View=View.Tile, which doesn't work correctly unless // we ran an app. -[Collection("ListViewUITests")] -[UISettings(MaxAttempts = 3)] // Try up to 3 times before failing. + public class ListViewTests : ControlTestBase { public ListViewTests(ITestOutputHelper testOutputHelper) @@ -40,7 +39,10 @@ await InputSimulator.SendAsync( }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/11328")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/11328")] public async Task ListView_Group_NavigateKeyboard_SucceedsAsync() { await RunTestAsync(async (form, listView) => @@ -109,7 +111,10 @@ await RunTestAsync(async (form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsTheory] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] [InlineData(2, 2, 150, 150, 0, 1, (int)NavigateDirection.NavigateDirection_FirstChild)] [InlineData(4, 3, 150, 150, 0, 3, (int)NavigateDirection.NavigateDirection_LastChild)] [InlineData(4, 1, 150, 150, 0, 1, (int)NavigateDirection.NavigateDirection_LastChild)] @@ -132,7 +137,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsTheory] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] [InlineData(1, 0, 150, 150, (int)NavigateDirection.NavigateDirection_FirstChild)] [InlineData(1, 2, 150, 150, (int)NavigateDirection.NavigateDirection_FirstChild)] [InlineData(2, 1, 10, 10, (int)NavigateDirection.NavigateDirection_FirstChild)] @@ -153,7 +161,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsTheory] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] [InlineData(4, 1)] [InlineData(2, 3)] public async Task ListView_Tile_SubItem_FragmentNavigate_Sibling_ReturnsNullAsync(int columnCount, int subItemsCount) @@ -173,7 +184,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsTheory] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] [InlineData(4, 3, 150, 150, 3)] [InlineData(4, 0, 150, 150, 0)] [InlineData(4, 1, 150, 150, 1)] @@ -195,7 +209,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsTheory] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] [InlineData(4, 1)] [InlineData(2, 5)] public async Task ListView_Tile_GetChildAsync(int columnCount, int subItemsCount) @@ -215,7 +232,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsTheory] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] [InlineData(4, 0, 150, 150)] [InlineData(1, 2, 150, 150)] [InlineData(2, 1, 10, 10)] @@ -235,7 +255,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsTheory] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] [InlineData(4, 1, 150, 150, -1, 1)] [InlineData(2, 1, 10, 10, -1, -1)] public async Task ListView_Tile_GetChildIndex_ForDifferentSize_ReturnsExpectedAsync(int columnCount, int subItemsCount, int width, int height, int expected1, int expected2) @@ -254,7 +277,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_SubItem_FragmentNavigate_NextSibling_ReturnsExpectedAsync() { await RunTestAsync((form, listView) => @@ -275,7 +301,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_SubItem_HitTest_ReturnExpectedAsync() { await RunTestAsync((form, listView) => @@ -301,7 +330,10 @@ Point GetSubItemLocation(int itemIndex, int subItemIndex) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_SubItem_FragmentNavigate_Sibling_ReturnsNull_For_SmallSizeAsync() { await RunTestAsync((form, listView) => @@ -319,7 +351,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_SubItem_FragmentNavigate_Child_ReturnsNullAsync() { await RunTestAsync((form, listView) => @@ -336,7 +371,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_GetChild_ReturnsExpectedAsync() { await RunTestAsync((form, listView) => @@ -356,7 +394,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_GetChild_ReturnsExpected_For_BigSizeAsync() { await RunTestAsync((form, listView) => @@ -378,7 +419,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_GetChildIndex_ReturnsExpectedAsync() { await RunTestAsync((form, listView) => @@ -397,7 +441,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_GetChildIndex_ReturnsExpected_SubItemsMoreThanColumnsAsync() { await RunTestAsync((form, listView) => @@ -417,7 +464,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_GetChildIndex_ReturnsMinusOne_For_Single_ColumnAsync() { await RunTestAsync((form, listView) => @@ -434,7 +484,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_GetChildIndex_ReturnsExpected_For_BigSizeAsync() { await RunTestAsync((form, listView) => @@ -460,7 +513,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13291")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13291")] public async Task ListView_Tile_ColumnProperty_ReturnsMinusOneAsync() { await RunTestAsync((form, listView) => @@ -476,7 +532,10 @@ await RunTestAsync((form, listView) => }); } + [ActiveIssue("https://github.com/dotnet/winforms/issues/13288")] [WinFormsFact] + [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, + "Flaky tests, see: https://github.com/dotnet/winforms/issues/13288")] public async Task ListView_Click_On_Second_Column_Does_Not_Alter_CheckBoxesAsync() { await RunTestAsync(async (form, listView) => From 7877f16465485a1b0c3889a8c43cefd233fdfde7 Mon Sep 17 00:00:00 2001 From: "Leaf Shi (BEYONDSOFT CONSULTING INC)" Date: Fri, 23 May 2025 17:09:07 +0800 Subject: [PATCH 2/3] Add Collection --- src/test/integration/UIIntegrationTests/ListViewTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/integration/UIIntegrationTests/ListViewTests.cs b/src/test/integration/UIIntegrationTests/ListViewTests.cs index a12727ec962..8b734822022 100644 --- a/src/test/integration/UIIntegrationTests/ListViewTests.cs +++ b/src/test/integration/UIIntegrationTests/ListViewTests.cs @@ -11,7 +11,8 @@ namespace System.Windows.Forms.UITests; // NOTE: This class contains many tests which don't require user input. Although they arguably belong to the unit // tests project, these tests assert behaviors of ListView.View=View.Tile, which doesn't work correctly unless // we ran an app. - +[Collection("ListViewUITests")] +[UISettings(MaxAttempts = 3)] // Try up to 3 times before failing. public class ListViewTests : ControlTestBase { public ListViewTests(ITestOutputHelper testOutputHelper) From e417e31cb93c0dbda3565905841027b02650dd7c Mon Sep 17 00:00:00 2001 From: Leaf Shi <132890443+LeafShi1@users.noreply.github.com> Date: Thu, 29 May 2025 09:54:56 +0800 Subject: [PATCH 3/3] Delete skip tag from test ListView_Click_On_Second_Column_Does_Not_Alter_CheckBoxesAsync --- src/test/integration/UIIntegrationTests/ListViewTests.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/test/integration/UIIntegrationTests/ListViewTests.cs b/src/test/integration/UIIntegrationTests/ListViewTests.cs index 8b734822022..be0afbdea3a 100644 --- a/src/test/integration/UIIntegrationTests/ListViewTests.cs +++ b/src/test/integration/UIIntegrationTests/ListViewTests.cs @@ -533,10 +533,7 @@ await RunTestAsync((form, listView) => }); } - [ActiveIssue("https://github.com/dotnet/winforms/issues/13288")] [WinFormsFact] - [SkipOnArchitecture(TestArchitectures.X86 | TestArchitectures.X64, - "Flaky tests, see: https://github.com/dotnet/winforms/issues/13288")] public async Task ListView_Click_On_Second_Column_Does_Not_Alter_CheckBoxesAsync() { await RunTestAsync(async (form, listView) =>