#2341 Testing projects xUnit v2 to v3 migration#2356
#2341 Testing projects xUnit v2 to v3 migration#2356raman-m merged 10 commits intoThreeMammals:developfrom
Conversation
|
I've been hitting intermittent "address already in use" failures on ConsulTests when running dotnet test. The issue seems to be that xUnit v3 compiles test projects as executables instead of class libraries. So when tests run across multiple target frameworks (net8.0/net9.0/net10.0), they spin up separate processes that run in parallel. I can confirm this because I don't face the same issue when I run dotnet run --framework net8.0/net9.0/net10.0. Edit: Same issue prior to upgrade. Is there a fix planned for this in roadmap? Maybe we can use port 0 and let the system handle the port selection? |
I've seen similar issues before, but with
Avoid running testing projects in parallel and instead mimic Visual Studio Test Explorer’s behavior. In Ocelot CI/CD setup (GitHub Actions), I've written scripts to run one testing project and one TFM at a time. |
Yes, I have also noticed an issue while running the test on a single TFM using xUnit v3 built-in runner. During the first run after a clean build, all the test cases seem to pass just fine. However, the subsequent runs fail due to port allocation (Ports are still being used). So, it could a process created during runtime that's non-terminated keeping the port still in use. Regarding your comment on stability when it comes to CI/CD test runner, I think it's because CI runner are ephemeral while our local machines are not. What are your thoughts on this?
Yes. I'll do that. |
|
@raman-m All changes are ready for review. |
Great! I will review after pushing an important commit to develop, hopefully in 2-3 days. |
|
Do you see the merge conflicts below? They need to be resolved first. The latest build has also failed, so I need to fix that issue before anything else. You will have to wait until the build in develop is fixed. |
I'll keep an eye on the develop build. I'll resolve the merge conflicts after the build succeeds. |
|
Should I sync this branch with develop? I can see the latest develop build has failed and changes haven't been made since then. What do you suggest @raman-m? |
|
@methran1304 yes, please. |
There was a problem hiding this comment.
There are some significant issues discovered in the test implementations and core library, but they fall outside the scope of this PR. These will be addressed in upcoming commits before the release.
Approved ✅
Just a note, more feedback on the user experience with the new testing v3 framework should be collected, as parallelization is a key focus for the team.
* upgraded xunit to v3 * xunit version bump v3.1.1 to v3.2.2 * upgraded xunit to v3 * bump xunit v3.1.1 to v3.2.2 * fixed PayLoadTooLargeTests skip condition. * revert unittests changes * fix conflict changes * Don't fail the build if code coverage drops below the threshold * Temp disable tests for PollKube provider --------- Co-authored-by: Raman Maksimchuk <dotnet044@gmail.com>

Closes #2341
This PR introduces xUnit v2 to v3 package upgrade for UnitTests and AcceptanceTests projects
Proposed Changes
Docs: Migration v2 to v3