Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip or fix flaky tests blocking CI #8603

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Tanya-Solyanik marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -7080,9 +7080,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