Skip to content

Use DotnetCli with UseAppHost=false on macOS for CrashDumpTests#6876

Merged
Youssef1313 merged 2 commits intodev/ygerges/unskip-CrashDumpTests-macosfrom
copilot/sub-pr-6874
Nov 4, 2025
Merged

Use DotnetCli with UseAppHost=false on macOS for CrashDumpTests#6876
Youssef1313 merged 2 commits intodev/ygerges/unskip-CrashDumpTests-macosfrom
copilot/sub-pr-6874

Conversation

Copy link
Contributor

Copilot AI commented Nov 4, 2025

Addresses review feedback from #6874 to align CrashDumpTests with the pattern used in HangDumpProcessTreeTests for macOS compatibility.

Changes

All four test methods in CrashDumpTests.cs now:

  • Detect macOS platform and set -p:UseAppHost=false to work around createdump issue with apphost
  • Use DotnetCli.RunAsync() instead of TestHost.ExecuteAsync()
  • Match the pattern from HangDump_DumpAllChildProcesses_CreateDump

Example

public async Task CrashDump_DefaultSetting_CreateDump(string tfm)
{
    string globalProperties = string.Empty;
    if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
    {
        globalProperties = "-p:UseAppHost=false";
    }

    DotnetMuxerResult result = await DotnetCli.RunAsync(
        $"run --project {AssetFixture.TargetAssetPath} -f {tfm} {globalProperties} --crashdump --results-directory {resultDirectory}",
        AcceptanceFixture.NuGetGlobalPackagesFolder.Path,
        failIfReturnValueIsNotZero: false,
        cancellationToken: TestContext.CancellationToken);
    // ...
}

Workaround for dotnet/runtime#119945 where createdump fails on apphost but works on dotnet process.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
@Youssef1313 Youssef1313 marked this pull request as ready for review November 4, 2025 10:39
@Youssef1313 Youssef1313 changed the title [WIP] Update CrashDumpTests on macOS to align with review feedback Update CrashDumpTests on macOS to align with review feedback Nov 4, 2025
@Youssef1313 Youssef1313 merged commit c495c54 into dev/ygerges/unskip-CrashDumpTests-macos Nov 4, 2025
3 checks passed
Copy link
Contributor Author

Copilot AI commented Nov 4, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 37bvsblobprodcus311.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/testfx/testfx/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/testfx/testfx/artifacts/toolset/11.0.0-beta.25553.1.txt (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Youssef1313 Youssef1313 deleted the copilot/sub-pr-6874 branch November 4, 2025 10:39
Copilot AI changed the title Update CrashDumpTests on macOS to align with review feedback Use DotnetCli with UseAppHost=false on macOS for CrashDumpTests Nov 4, 2025
Copilot AI requested a review from Youssef1313 November 4, 2025 10:39
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