Skip to content

Commit

Permalink
Skip or fix flaky tests blocking CI (#8603)
Browse files Browse the repository at this point in the history
* Skip or fix flaky tests

Related to:

#8602
#8601
#8598

* Skipping test related to #6610
  • Loading branch information
dreddy-work committed Feb 9, 2023
1 parent 65bd356 commit 4d2a8ad
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,18 @@ public void ConfigSwitch_Disabled_SuspendedLayout_AnchorsComputed()
private static void LaunchFormAndVerify(AnchorStyles anchors, int expectedX, int expectedY, int expectedWidth, int expectedHeight)
{
(Form form, Button button) = GetFormWithAnchoredButton(anchors);

Rectangle newButtonBounds = button.Bounds;
try
{
form.ResumeLayout(true);
form.Controls.Add(button);
form.Shown += OnFormShown;
form.ShowDialog();

Assert.Equal(expectedX, newButtonBounds.X);
Assert.Equal(expectedY, newButtonBounds.Y);
Assert.Equal(expectedWidth, newButtonBounds.Width);
Assert.Equal(expectedHeight, newButtonBounds.Height);
}
finally
{
Expand All @@ -178,13 +183,7 @@ void OnFormShown(object? sender, EventArgs e)
{
// Resize the form to compute button anchors.
form.Size = new Size(400, 600);
Rectangle buttonBounds = button.Bounds;

Assert.Equal(expectedX, buttonBounds.X);
Assert.Equal(expectedY, buttonBounds.Y);
Assert.Equal(expectedWidth, buttonBounds.Width);
Assert.Equal(expectedHeight, buttonBounds.Height);

newButtonBounds = button.Bounds;
form.Close();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ await InputSimulator.SendAsync(
Assert.Equal(button?.Text, ((Button)data).Text);
}

[WinFormsFact]
[WinFormsFact(Skip = "Crashes dotnet.exe, see: https://github.com/dotnet/winforms/issues/8598")]
public async Task DragDrop_RTF_FromExplorer_ToRichTextBox_ReturnsExpected_Async()
{
await RunTestAsync(async dragDropForm =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public unsafe void ConvertManagedToNative_Icon()
Assert.Same(exclamationIcon, Instance.ConvertNativeToManaged(picture, null));
}

[Fact]
[Fact(Skip = "Flaky test being investigated. see:https://github.com/dotnet/winforms/issues/8602")]
public unsafe void ConvertManagedToNative_Bitmap()
{
bool cancelSet = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void EmbeddedResource_ResourcesExist_Icon(string resourceName)
public static TheoryData ExpectedCursorNames()
=> (TheoryData)s_expectedCursorNames.Split(Environment.NewLine).ToTheoryData();

[Theory]
[Theory(Skip = "Flaky test being investigated. See: https://github.com/dotnet/winforms/issues/8601")]
[MemberData(nameof(ExpectedCursorNames))]
public void EmbeddedResource_ResourcesExist_Cursor(string resourceName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7104,9 +7104,7 @@ public void ToolStrip_SetItemLocation_ItemHasDifferentParent_ThrowsNotSupportedE
}

[ActiveIssue("https://github.com/dotnet/winforms/issues/6610")]
[WinFormsFact]
[SkipOnArchitecture(TestArchitectures.X86,
"Flaky tests, see: https://github.com/dotnet/winforms/issues/6610")]
[WinFormsFact(Skip = "Flaky tests, see: https://github.com/dotnet/winforms/issues/6610")]
public void ToolStrip_WndProc_InvokeMouseActivate_Success()
{
using var control = new SubToolStrip();
Expand Down

0 comments on commit 4d2a8ad

Please sign in to comment.