-
Notifications
You must be signed in to change notification settings - Fork 858
[Tests] Fix flaky tests #6734
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
[Tests] Fix flaky tests #6734
Conversation
Refactor two different test classes to try and avoid flakiness in CI.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6734 +/- ##
=======================================
Coverage 86.85% 86.85%
=======================================
Files 258 258
Lines 11990 11990
=======================================
Hits 10414 10414
Misses 1576 1576
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses flaky test failures in two test classes by improving timing reliability and refactoring code for better clarity. The changes focus on ensuring proper resource cleanup timing and verifying that ForceFlush operations complete successfully.
- Increased timeout for flush operations from 10 seconds to 15 seconds to accommodate slower CI environments
- Wrapped MeterProvider instances in using blocks to ensure disposal happens after final assertions
- Added assertions to verify ForceFlush operations succeed rather than silently ignoring failures
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| MetricPointReclaimTests.cs | Refactored to ensure MeterProvider disposal occurs after all measurements are validated, converted variables to constants |
| MetricExemplarTests.cs | Increased flush timeout and added assertions to verify ForceFlush success, simplified conditional expressions and loop variable destructuring |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes
Refactor two different test classes to try and avoid flakiness in CI.
Also fixes the IDE suggestions from Visual Studio while I was touching the files.
First:
Second:
Merge requirement checklist
AppropriateCHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)