Skip to content

Flaky Clipboard Unit Tests #3456

@weltkante

Description

@weltkante

.NET Core Version:
master

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

Problem description:
Noticed as a flaky test:

System.Windows.Forms.Tests.TextBoxBaseTests.TextBoxBase_Paste_InvokeNotEmpty_Success [FAIL]
Assert.Equal() Failure
� (pos 1)
Expected: abc
Actual: a
� (pos 1)
Stack Trace:
F:\workspace_work\1\s\src\System.Windows.Forms\tests\UnitTests\TextBoxBaseTests.cs(5957,0): at System.Windows.Forms.Tests.TextBoxBaseTests.TextBoxBase_Paste_InvokeNotEmpty_Success()

Test seems to assume clipboard is empty/nonfunctional (there is at least one more test along these, should review for more clipboard-dependent tests)

Also any clipboard tests need to be [Collection("Sequential")] to avoid overlapping with other clipboard tests. Is it worth making the whole test class sequential just due to that single test? should the test be moved?

Expected behavior:
Clipboard based tests initialize clipboard to be in known state and are marked for sequential execution

Minimal repro:
none, flaky test

Metadata

Metadata

Assignees

Labels

area-ClipboardIssues related to Clipboardtest-bugProblem in test source code (most likely)test-enhancementImprovements of test source code

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions