Skip to content

Skip .NET SDK first-run experience in Helix work items#66916

Merged
wtgodbe merged 3 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/skip-first-run-experience
May 30, 2026
Merged

Skip .NET SDK first-run experience in Helix work items#66916
wtgodbe merged 3 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/skip-first-run-experience

Conversation

@wtgodbe

@wtgodbe wtgodbe commented May 29, 2026

Copy link
Copy Markdown
Member

Root cause

The DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 variable set in runtests.sh/runtests.cmd is deprecated and no longer honored in .NET 8+. This means the .NET SDK first-run experience (including HTTPS dev cert generation) runs on every Helix work item.

On macOS Helix machines, the dev cert generation hangs for >2 minutes, exceeding the HelixTestRunner's 2-minute timeout and killing the dotnet process (exit code 130). From the logs:

Passing machine (dci-mac-build-365): first-run takes 64 seconds — barely fits

14:35:55 Welcome to .NET 11.0!
14:36:59 Installed an ASP.NET Core HTTPS development certificate.

Failing machine (dci-mac-build-322): first-run hangs >2 minutes → killed

14:37:54 Welcome to .NET 11.0!
14:39:54 completed with exit code '130'

This is the root cause of the widespread macOS CI failures (osx.15.amd64.open queue) that have been blocking PRs for over a week. Running dotnet tool install manually on the machines works fine because the first-run has already completed from that interactive session.

Fix

Replace the deprecated variable with the current equivalents:

  • DOTNET_GENERATE_ASPNET_CERTIFICATE=false — skips the dev cert generation (the actual hang)
  • DOTNET_NOLOGO=1 — suppresses the welcome banner

Set in three places to cover all code paths:

  • runtests.sh / runtests.cmd — covers the outer dotnet HelixTestRunner.dll invocation
  • TestRunner.cs — covers child process invocations (dotnet tool install, dotnet nuget, etc.)

The .NET SDK first-run experience (welcome message, HTTPS dev cert
generation, NuGet cache population) hangs on some macOS Helix machines
during cert installation, taking >2 minutes and getting killed by the
HelixTestRunner timeout (exit code 130).

Setting DOTNET_NOLOGO and DOTNET_SKIP_FIRST_TIME_EXPERIENCE bypasses
this entirely. The dev cert and NuGet cache are not needed for test
execution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wtgodbe wtgodbe requested a review from a team as a code owner May 29, 2026 19:22
Copilot AI review requested due to automatic review settings May 29, 2026 19:22
@github-actions github-actions Bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label May 29, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@wtgodbe wtgodbe marked this pull request as draft May 29, 2026 19:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Helix test runner’s process environment to avoid .NET SDK first-run initialization during Helix work item execution, addressing macOS Helix hangs during HTTPS dev cert installation that lead to timeouts and CI failures.

Changes:

  • Set DOTNET_NOLOGO=1 to suppress the .NET CLI welcome/banner output.
  • Set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 to skip .NET SDK first-run behaviors (including dev cert generation) for all dotnet invocations made by the HelixTestRunner.

wtgodbe and others added 2 commits May 29, 2026 12:29
DOTNET_SKIP_FIRST_TIME_EXPERIENCE is deprecated and no longer honored
in .NET 8+. The actual hang is in HTTPS dev cert generation, so set
DOTNET_GENERATE_ASPNET_CERTIFICATE=false to skip it specifically.

Also add DOTNET_NOLOGO and DOTNET_GENERATE_ASPNET_CERTIFICATE to
runtests.sh and runtests.cmd alongside the existing (deprecated)
DOTNET_SKIP_FIRST_TIME_EXPERIENCE, covering both the outer dotnet
invocation and the inner HelixTestRunner child processes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
// DOTNET_SKIP_FIRST_TIME_EXPERIENCE is deprecated and no longer honored
// in .NET 8+. The replacement is individual controls:
// - DOTNET_NOLOGO: suppresses the welcome banner
// - DOTNET_GENERATE_ASPNET_CERTIFICATE: skips dev cert generation (the hang)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be related to #66727

@Youssef1313 Youssef1313 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Let's ensure we have some tracking issue to revert once the root cause is fixed.

@wtgodbe wtgodbe marked this pull request as ready for review May 30, 2026 02:16
@wtgodbe

wtgodbe commented May 30, 2026

Copy link
Copy Markdown
Member Author

#66925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants