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

Address flaky UI framework tests #1379

Merged
merged 2 commits into from
Oct 7, 2020
Merged

Conversation

bartdesmet
Copy link
Collaborator

These WinForms and WPF tests go all the way back to a private test infrastructure (prior to OSS) and later MsTest, and never were hardened against concurrent execution of test cases; they were always run sequentially. This has led to flakiness at some point later, maybe during the migration to Xunit, and it seems nobody ever addressed this.

This PR hardens things in a few ways:

  • Ensure only one test for WinForms can run at a given point in time, to avoid multiple running UI threads. Same for WPF.
  • Make tests hygienic, i.e. guarantee clean up of the thread they've spawn, and exiting the message loop (e.g. dispatcher).
  • Avoid calling Application.Exit on a different thread.
  • Simplify the way to write test code.

After this goes in, we can likely re-enable some tests that were disabled, possibly because folks observed flakiness (e.g. ObserveOn tests getting stuck indefinitely because another test case ran Application.Exit and killed the message loop from underneath the test).

@bartdesmet bartdesmet merged commit ffc86bb into main Oct 7, 2020
@bartdesmet bartdesmet deleted the dev/bartde/fix_flaky_ui_tests branch October 7, 2020 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant