You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Chore] Tests are still on xunit v2, which is deprecated and hasn't had a release since January 2025 #4528
Is your feature request related to a problem? Please describe.
All the test projects use xunit 2.9.3. That came out in January 2025 and the release notes already said it should be the last v2 release. The package is deprecated on NuGet, with a note that it'll only get security fixes and all new work is on v3.
There's also a practical problem with it. Xunit v2 doesn't support IAsyncDisposable on test classes (v3 does, see the docs), so DisposeAsync just never gets called. I found 24 test classes on master that only implement IAsyncDisposable, so their cleanup never runs. For example SqsSchedulingAsyncMessageTest is supposed to delete its SQS queue there. Same root cause as the S3 buckets in bugfixes/0032-s3-test-bucket-cleanup.
Describe the solution you'd like
Move to xunit.v3. CI doesn't need to change for that, if you keep xunit.runner.visualstudio and set IsTestingPlatformApplication=false the projects still run with dotnet test on VSTest. MTP could come later. xunit.v3 3.1.0 is already in Directory.Packages.props, just not used anywhere.
Things to watch out for: test projects need OutputType=Exe, IAsyncLifetime uses ValueTask in v3 (so the test generator templates need updating too), and when a class implements both IDisposable and IAsyncDisposable v3 only calls DisposeAsync. There are 183 of those, so anything that only happens in Dispose would need moving.
There's an agent skill for this migration that covers the VSTest setup as well: migrate-xunit-to-xunit-v3. Could be useful with the /spec workflow.
Describe alternatives you've considered
TUnit, like in #4065. But Fences is already going to xunit v3 / MTP (BrighterCommand/Fences#34, porting it from Polly), so xunit would keep both repos on the same framework. There was also #3844, which got folded into #3971 and then closed without being merged.
changed the title [-]Tests are still on xunit v2, which is deprecated and hasn't had a release since January 2025[/-][+][Chore] Tests are still on xunit v2, which is deprecated and hasn't had a release since January 2025[/+]on Oct 15, 2026
Activity
iancooper commentedon Oct 5, 2026
Good call
[-]Tests are still on xunit v2, which is deprecated and hasn't had a release since January 2025[/-][+][Chore] Tests are still on xunit v2, which is deprecated and hasn't had a release since January 2025[/+]