Skip to content

Conversation

@gimlichael
Copy link
Member

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:

  • Added a step to the GitHub Actions workflow (.github/workflows/ci-pipeline.yml) that ensures all xUnit v3 test apphosts are marked as executable on Linux, preventing permission issues during test runs.

@gimlichael gimlichael self-assigned this Dec 7, 2025
Copilot AI review requested due to automatic review settings December 7, 2025 11:37
Copy link

Copilot AI left a 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_test job in the GitHub Actions workflow that uses find and chmod to ensure all xUnit v3 test apphost files are executable on Linux
  • Extended the benchmark project configuration in Directory.Build.props with 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>
Copy link

Copilot AI Dec 7, 2025

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.

Suggested change
<TargetFrameworks>net10.0;net9.0</TargetFrameworks>

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Dec 7, 2025

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 || true

Note: 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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines +139 to +141
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 {} +
Copy link

Copilot AI Dec 7, 2025

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.

Suggested change
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 {} +

Copilot uses AI. Check for mistakes.
@gimlichael gimlichael merged commit 61b5ed7 into main Dec 7, 2025
170 of 602 checks passed
@gimlichael gimlichael deleted the v10.1.0/xunitv3-troubleshooting branch December 7, 2025 12:06
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.

2 participants