Repository: dotnet/winforms

Issue #6609: Some RichTextBox tests are flaky in x86 and x64 Debug CI build
Created: 2022-02-03T13:00:09Z
.NET Core Version: 7.0


Have you experienced this same bug with .NET Framework?: No


Problem description:
Tests fails sometime in x86 and x64 CI build for successful PRs, that blocking deployment of fixes into sdk:

(x86) RichTextBox_Text_GetWithHandle_ReturnsExpected:
Stack trace (System.Windows.Forms.Tests_net7.0_x86.log):

System.Windows.Forms.Tests.RichTextBoxTests.RichTextBox_Text_GetWithHandle_ReturnsExpected [FAIL]
      Assert.Equal() Failure
                (pos 0)
      Expected: a?b
      Actual:   ?b
                (pos 0)
      Stack Trace:
        /_/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/RichTextBoxTests.cs(6920,0): at System.Windows.Forms.Tests.RichTextBoxTests.RichTextBox_Text_GetWithHandle_ReturnsExpected()


(x64) RichTextBox_Click_On_Custom_Link_Followed_By_Hidden_Text_Provides_Displayed_Link_SpanAsync:
Stack trace (buildId=1621721):
Assert.InRange() Failure\r\nRange:  (243 - 245)\r\nActual: 5
at System.Windows.Forms.UITests.ControlTestBase.MoveMouseAsync(Form window, Point point, Boolean assertCorrectLocation) in /_/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Infra/ControlTestBase.cs:line 148
at System.Windows.Forms.UITests.RichTextBoxTests.<RichTextBox_Click_On_Custom_Link_Followed_By_Hidden_Text_Provides_Displayed_Link_SpanAsync>b__5_0(Form form, RichTextBox richTextBox) in /_/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/RichTextBoxTests.cs:line 209
at System.Windows.Forms.UITests.RichTextBoxTests.<RichTextBox_Click_On_Custom_Link_Followed_By_Hidden_Text_Provides_Displayed_Link_SpanAsync>b__5_0(Form form, RichTextBox richTextBox) in /_/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/RichTextBoxTests.cs:line 227
at System.Windows.Forms.UITests.ControlTestBase.<>c__DisplayClass27_0`1.<<RunFormAsync>b__0>d.MoveNext() in /_/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Infra/ControlTestBase.cs:line 236

at Microsoft.VisualStudio.Threading.JoinableTask.JoinAsync(CancellationToken cancellationToken)
at System.Windows.Forms.UITests.ControlTestBase.RunFormAsync[T](Func`1 createDialog, Func`3 testDriverAsync) in /_/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Infra/ControlTestBase.cs:line 255
at System.Windows.Forms.UITests.ControlTestBase.RunSingleControlTestAsync[T](Func`3 testDriverAsync, Func`1 createControl, Func`1 createForm) in /_/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Infra/ControlTestBase.cs:line 173
at System.Windows.Forms.UITests.RichTextBoxTests.RunTestAsync(Func`3 runTest) in /_/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/RichTextBoxTests.cs:line 317
at System.Windows.Forms.UITests.RichTextBoxTests.RichTextBox_Click_On_Custom_Link_Followed_By_Hidden_Text_Provides_Displayed_Link_SpanAsync() in /_/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/RichTextBoxTests.cs:line 175




Expected behavior:
All correct tests pass every time.
Minimal repro:

Run unit tests on x86/x64 environment (or create a PR with changes, CI build will do it)

Duplicate issue #4347: Flaky test: `RichTextBox_Text_GetWithHandle_ReturnsExpected`
Created: 2020-12-10T02:21:01Z
Problem description:
Few variations, but generally the failing point is this:
    System.Windows.Forms.Tests.RichTextBoxTests.RichTextBox_Text_GetWithHandle_ReturnsExpected [FAIL]
      Assert.Equal() Failure
                � (pos 0)
      Expected: a?b
      Actual:   ?b
                � (pos 0)
      Stack Trace:
        /_/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/RichTextBoxTests.cs(6918,0): at System.Windows.Forms.Tests.RichTextBoxTests.RichTextBox_Text_GetWithHandle_ReturnsExpected()

The test started failing repeatedly recently, in x86 and only on the public CI.
Observed:

Reported #4342 (comment)
https://dev.azure.com/dnceng/public/_build/results?buildId=913908&view=results

Closing comment (2023-03-11T23:59:46Z): Dupe of #6609