-
Notifications
You must be signed in to change notification settings - Fork 5
V10.1.0/xunitv3 troubleshooting #135
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
Conversation
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 pull request addresses xUnit v3 test execution issues on Linux by ensuring test apphost executables have proper execute permissions. The PR adds a workaround step in the CI pipeline that explicitly sets execute permissions on xUnit v3 test apphosts before running integration tests, preventing "Permission denied" errors that were occurring randomly on Linux runners.
Key changes:
- Added a pre-test step to the
integration_testjob in the GitHub Actions workflow that usesfindandchmodto ensure all xUnit v3 test apphost files are executable on Linux - Extended the benchmark project configuration in
Directory.Build.propswith additional build and analysis settings (though this includes a duplicate property declaration)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/ci-pipeline.yml |
Added a "Fix Linux test apphost permissions" step to the integration_test job that makes xUnit v3 test executables runnable on Linux by setting execute permissions before test execution |
Directory.Build.props |
Extended the benchmark project PropertyGroup with additional configuration settings to disable analyzers, auditing, and warnings (note: contains a duplicate TargetFrameworks property) |
|
|
||
| <PropertyGroup Condition="'$(IsBenchmarkProject)' == 'true'"> | ||
| <TargetFrameworks>net10.0;net9.0</TargetFrameworks> | ||
| <TargetFrameworks>net10.0;net9.0</TargetFrameworks> |
Copilot
AI
Dec 7, 2025
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.
Duplicate TargetFrameworks property declaration. Line 113 and 114 both set TargetFrameworks to net10.0;net9.0. Remove the duplicate on line 114.
| <TargetFrameworks>net10.0;net9.0</TargetFrameworks> |
| echo "Ensuring xUnit v3 test apphosts are executable on Linux..." | ||
| echo "Configuration: ${{ matrix.configuration }}" | ||
| # Dump a bit of info for debugging | ||
| find . -path "*/bin/${{ matrix.configuration }}/net*/*" -maxdepth 1 -type f -name "*Tests*" -print || true |
Copilot
AI
Dec 7, 2025
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.
The -maxdepth 1 option is placed incorrectly in the find command. In find, -maxdepth must appear before other search criteria like -type and -name. The correct placement is:
find . -maxdepth 4 -path "*/bin/${{ matrix.configuration }}/net*/*" -type f -name "*Tests*" -print || trueNote: Since you're searching for paths like */bin/${{ matrix.configuration }}/net*/*, you need a maxdepth of at least 4-5 levels from the current directory (e.g., ./test/ProjectName.Tests/bin/Debug/net10.0/ProjectName.Tests). Alternatively, remove -maxdepth entirely from the debug line since it's only for informational purposes.
| find . -path "*/bin/${{ matrix.configuration }}/net*/*" -maxdepth 1 -type f -name "*Tests*" -print || true | |
| find . -maxdepth 4 -path "*/bin/${{ matrix.configuration }}/net*/*" -type f -name "*Tests*" -print || true |
| find . -path "*/bin/${{ matrix.configuration }}/net*/*" -maxdepth 1 -type f -name "*Tests*" -print || true | ||
| # Actually fix permissions | ||
| find . -path "*/bin/${{ matrix.configuration }}/net*/*" -type f -name "*Tests*" -exec chmod +x {} + |
Copilot
AI
Dec 7, 2025
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.
[nitpick] The find command on line 141 will attempt to set execute permissions on all files matching *Tests*, which may include non-executable files like .dll, .pdb, .deps.json, .runtimeconfig.json, etc. Consider being more specific by targeting only the actual apphost executables (files without extensions or with specific patterns). For example:
find . -path "*/bin/${{ matrix.configuration }}/net*/*" -type f -name "*Tests" ! -name "*.*" -exec chmod +x {} +This matches files named *Tests without any extension, which is typical for Linux apphost executables.
| find . -path "*/bin/${{ matrix.configuration }}/net*/*" -maxdepth 1 -type f -name "*Tests*" -print || true | |
| # Actually fix permissions | |
| find . -path "*/bin/${{ matrix.configuration }}/net*/*" -type f -name "*Tests*" -exec chmod +x {} + | |
| find . -path "*/bin/${{ matrix.configuration }}/net*/*" -maxdepth 1 -type f -name "*Tests" ! -name "*.*" -print || true | |
| # Actually fix permissions | |
| find . -path "*/bin/${{ matrix.configuration }}/net*/*" -type f -name "*Tests" ! -name "*.*" -exec chmod +x {} + |
This pull request introduces work-arounds for the continued struggle with xUnit v3. Looks like for Linux run it can randomly trigger something like:
Catastrophic failure: System.ComponentModel.Win32Exception (13): An error occurred trying to start process '/home/runner/work/cuemon/cuemon/test/AssemblyName.Tests/bin/Debug/net10.0/AssemblyName.Tests' with working directory '/home/runner/work/cuemon/cuemon/test/AssemblyName.Tests/bin/Debug/net10.0'. Permission denied.I have been unable to find the common denominator - as it worked without flaws from PRs.
After merge to main - shit hits the fan. So now I always provide execute permission.
IMO, xUnit v2 was a much better product - but since its being deprecated, hopefully v3 will get some love and less headache inducing troubleshooting like this one.
CI Pipeline improvements:
.github/workflows/ci-pipeline.yml) that ensures all xUnit v3 test apphosts are marked as executable on Linux, preventing permission issues during test runs.