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: Adding Async Lifetime method to fix flaky unit tests #333

Merged
merged 5 commits into from
Dec 19, 2024

Conversation

askpt
Copy link
Member

@askpt askpt commented Dec 18, 2024

This PR

  • Changes the way we currently reset the Api between unit tests. This approach should be safer since it calls the official Shutdown, and when we call the API again, all the resources are reset.

Notes

Check for more details: https://xunit.net/docs/shared-context#:~:text=For%20context%20cleanup%2C%20add%20the%20IDisposable%20interface%20to,call%20IAsyncDisposable%20%28it%20is%20planned%20for%20xUnit%20v3%29.

Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
@askpt askpt requested a review from a team as a code owner December 18, 2024 15:42
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.30%. Comparing base (6c4cd02) to head (bfd7340).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #333      +/-   ##
==========================================
- Coverage   85.54%   85.30%   -0.25%     
==========================================
  Files          36       36              
  Lines        1474     1477       +3     
  Branches      150      150              
==========================================
- Hits         1261     1260       -1     
- Misses        183      187       +4     
  Partials       30       30              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
@toddbaert toddbaert merged commit e14ab39 into main Dec 19, 2024
14 of 15 checks passed
@askpt askpt deleted the askpt/fix-flaky-tests branch December 19, 2024 19:27
kylejuliandev pushed a commit to kylejuliandev/dotnet-sdk that referenced this pull request Jan 9, 2025
…re#333)

<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- Changes the way we currently reset the Api between unit tests. This
approach should be safer since it calls the official `Shutdown`, and
when we call the API again, all the resources are reset.

### Notes
<!-- any additional notes for this PR -->
Check for more details:
https://xunit.net/docs/shared-context#:~:text=For%20context%20cleanup%2C%20add%20the%20IDisposable%20interface%20to,call%20IAsyncDisposable%20%28it%20is%20planned%20for%20xUnit%20v3%29.

---------

Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
toddbaert added a commit that referenced this pull request Jan 31, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.3.0](v2.2.0...v2.3.0)
(2025-01-31)


### ⚠ BREAKING CHANGES

#### Hook Changes

The signature of the `finally` hook stage has been changed. The
signature now includes the `evaluation details`, as per the [OpenFeature
specification](https://openfeature.dev/specification/sections/hooks#requirement-438).
Note that since hooks are still `experimental,` this does not constitute
a change requiring a new major version. To migrate, update any hook that
implements the `finally` stage to accept `evaluation details` as the
second argument.

* Add evaluation details to finally hook stage
([#335](#335))
([2ef9955](2ef9955))

#### .NET 6

Removed support for .NET 6.

* add dotnet 9 support, rm dotnet 6
([#317](#317))
([2774b0d](2774b0d))

### 🐛 Bug Fixes

* Adding Async Lifetime method to fix flaky unit tests
([#333](#333))
([e14ab39](e14ab39))
* Fix issue with DI documentation
([#350](#350))
([728ae47](728ae47))


### ✨ New Features

* add dotnet 9 support, rm dotnet 6
([#317](#317))
([2774b0d](2774b0d))
* Add evaluation details to finally hook stage
([#335](#335))
([2ef9955](2ef9955))
* Implement Default Logging Hook
([#308](#308))
([7013e95](7013e95))
* Implement transaction context
([#312](#312))
([1b5a0a9](1b5a0a9))


### 🧹 Chore

* **deps:** update actions/upload-artifact action to v4.5.0
([#332](#332))
([fd68cb0](fd68cb0))
* **deps:** update codecov/codecov-action action to v5
([#316](#316))
([6c4cd02](6c4cd02))
* **deps:** update codecov/codecov-action action to v5.1.2
([#334](#334))
([b9ebddf](b9ebddf))
* **deps:** update codecov/codecov-action action to v5.3.1
([#355](#355))
([1e8ebc4](1e8ebc4))
* **deps:** update dependency coverlet.collector to 6.0.3
([#336](#336))
([8527b03](8527b03))
* **deps:** update dependency coverlet.msbuild to 6.0.3
([#337](#337))
([26fd235](26fd235))
* **deps:** update dependency dotnet-sdk to v9.0.101
([#339](#339))
([dd26ad6](dd26ad6))
* **deps:** update dependency fluentassertions to 7.1.0
([#346](#346))
([dd1c8e4](dd1c8e4))
* **deps:** update dependency microsoft.net.test.sdk to 17.12.0
([#322](#322))
([6f5b049](6f5b049))


### 📚 Documentation

* disable space in link text lint rule
([#329](#329))
([583b2a9](583b2a9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
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.

3 participants