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

Fix Flaky Core Tests #23600

Merged
merged 6 commits into from
Aug 17, 2021
Merged

Conversation

alzimmermsft
Copy link
Member

@alzimmermsft alzimmermsft commented Aug 16, 2021

This PR fixes flaky tests in azure-core. They fall under the following categories:

  • Usage of global resources which introduced race conditions.

    • These were resolved with the usage of JUnit's Isolation annotation which runs the annotated test class in a thread safe fashion. Additionally, these test classes were also annotation with Execution(ExecutionMode.SAME_THREAD) to run the tests contained in the class sequentially.
  • Replaced usage of publishOn(Schedulers.parallel()) to parallel().runOn(Schedulers.parallel()) to better ensure parallel execution of logic.

@alzimmermsft alzimmermsft added Client This issue points to a problem in the data-plane of the library. Azure.Core azure-core labels Aug 16, 2021
@alzimmermsft alzimmermsft self-assigned this Aug 16, 2021
@alzimmermsft alzimmermsft enabled auto-merge (squash) August 16, 2021 18:37
Comment on lines +47 to +48
// Ensure that only one refresh attempt is made.
assertEquals(1, refreshes.get());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 this is great!

@alzimmermsft alzimmermsft merged commit acdfb61 into Azure:main Aug 17, 2021
@alzimmermsft alzimmermsft deleted the AzCore_FixFlakyTests branch April 4, 2022 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core azure-core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants