-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Flaky Clipboard Unit Tests #3456
Comments
I wonder if we could employ [Trait(Category.Synchronous, Category.Clipboard)] // arbitrary strings represented by consts
[WinFormsFact]
public void TextBoxBase_Paste_InvokeNotEmpty_Success()
{
// ...
} ...and then update our CI configs to run tests separately: Lines 98 to 107 in 0f90af4
# Run Unit Tests
# Tests are run with /m:1 to work around https://github.com/tonerdo/coverlet/issues/364
- script: eng\cibuild.cmd
-test
-configuration $(_BuildConfig)
$(_OfficialBuildIdArgs)
/p:Coverage=$(_Coverage)
/bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Test.binlog
/m:1
-trait "Synchronous=Clipboard"
displayName: Run Unit Tests (Synchronous)
- script: eng\cibuild.cmd
-test
-configuration $(_BuildConfig)
$(_OfficialBuildIdArgs)
/p:Coverage=$(_Coverage)
/bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Test.binlog
/m:1
-notrait "Synchronous=Clipboard"
displayName: Run Unit Tests Got some inspiration from http://www.brendanconnolly.net/organizing-tests-with-xunit-traits/ |
Failed test
Since clipboard tests are not |
FYI I started looking into adding traits |
Failed again:
|
One way of tracking rolling failures: https://runfo.azurewebsites.net/search/tests/?q=started%3A~14+definition%3A267+kind%3Arolling |
Related to #6269 |
This is a matter of making sure everything that might touch the clipboard is in a non-parallelized collection and ensuring that everything has sufficient retries. I've had some success in the clipboard tests in my thirtytwo project with them running stably. See: https://github.com/JeremyKuhne/thirtytwo/blob/main/src/thirtytwo_tests/ClipboardTestCollection.cs |
Yes |
.NET Core Version:
master
Have you experienced this same bug with .NET Framework?:
no
Problem description:
Noticed as a flaky test:
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
The text was updated successfully, but these errors were encountered: