Skip to content

[ci] Fix internal builds - #20448

Closed
Ankit Jain (radical) wants to merge 3 commits into
microsoft:mainfrom
radical:fix-template-test-failure
Closed

Ankit Jain (radical) wants to merge 3 commits into
microsoft:mainfrom
radical:fix-template-test-failure

Conversation

@radical

@radical Ankit Jain (radical) commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Description

Official internal builds are broken because the Template Tests stage now needs about 25 minutes, but the test session is terminated after 20 minutes. The completed tests pass; the pipeline fails because Microsoft.Testing.Platform aborts the still-running session.

In build 3086035, 129 tests passed with no failures before the deadline:

Test run summary: Aborted
  total: 129
  failed: 0
  succeeded: 129
  duration: 20m 01s 713ms

The timeout exits with code 3. The existing --ignore-exit-code 8 behavior did not change and is unrelated: exit code 8 only represents a run in which no tests executed.

Why it started failing

#20046 added two 51-case starter-template classes, increasing the internal basic-build workload by 102 cases. GitHub CI shards these tests by class, but the internal pipeline runs every basic-build case in one process.

That PR also upgraded xUnit to v4. The internal run initially failed before executing tests because the runner still passed the removed --report-xunit options. #20314 corrected the reporting options, allowing the expanded suite to run and exposing the 20-minute timeout:

Root cause

The workload increase made the existing 20-minute session limit too short. A separate, previously latent evaluation-order bug prevented the template project from overriding that limit correctly.

MtpBaseArgs was composed in eng/Testing.props before the project file was evaluated. Although the template project declared a 15-minute hang timeout, the emitted command still used the repository defaults:

--hangdump-timeout 10m --timeout 20m

The Azure Pipelines job also had a 30-minute limit, leaving no setup or cleanup headroom around a 30-minute test session.

Fix

  • Compose shared MTP arguments in eng/Testing.targets, after project evaluation, so project timeout overrides take effect.
  • Give the combined internal basic-build invocation a 30-minute session timeout while retaining the 20-minute timeout for class-sharded runs.
  • Increase the Azure Pipelines job limit to 45 minutes.
  • Add regression coverage for the emitted class-sharded and internal argument sets.
  • Update documentation and workflow references to the new authoritative argument-composition location.

Validation

--hangdump-timeout 15m --timeout 30m

The template-test task succeeded. The validation used a template-only scratch pipeline and reused package artifacts from the earlier full build, so it does not represent a complete internal pipeline run at this PR's head.

Surprises and call-outs

  • Moving composition to Testing.targets makes existing project-level MTP timeout overrides effective across the repository, not only for template tests.
  • The current internal suite leaves about 4.5 minutes of session headroom. Further substantial matrix growth may require sharding the internal template run rather than increasing the timeout again.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Internal template builds abort after 20 minutes after the expanded
starter-template matrix, even though the template project declares custom
timeout values.

MtpBaseArgs was composed from defaults in Testing.props before project-level
properties were evaluated, so the declared 15-minute hang timeout was emitted
as 10 minutes and the basic-build session remained capped at 20 minutes.

Compose the MTP arguments from Testing.targets after project evaluation, give
the combined internal basic-build run a 30-minute session budget, and add
regression coverage for both the normal and basic-build argument sets.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The Template Tests job includes checkout, artifact staging, and SDK preparation
within its existing 30-minute limit. Raising the test session timeout to 30
minutes would still allow the enclosing Azure Pipelines job to terminate the
run before the test host reaches its own deadline.

Give the job a 45-minute budget so the combined basic-build suite receives its
full timeout plus setup and cleanup headroom.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20448

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20448"

@github-actions github-actions Bot added the area-engineering-systems infrastructure helix infra engineering repo stuff label Sep 24, 2026
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 24, 2026 21:08

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.

Copilot review overview

🟡 Changes recommended

Several authoritative references still incorrectly identify Testing.props as the MTP argument source.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Moves MTP argument composition to post-project evaluation so template-specific timeouts take effect.

Changes:

  • Composes MTP arguments in Testing.targets.
  • Adds a 30-minute combined template-test timeout and 45-minute job budget.
  • Adds regression coverage and documentation.
File Description
eng/​Testing.props Removes early MTP argument composition.
eng/​Testing.targets Composes arguments after project evaluation.
eng/​pipelines/​azure-pipelines.yml Extends the template-test job timeout.
tests/​Aspire.Templates.Tests/​Aspire.Templates.Tests.csproj Adds the basic-build session timeout.
tests/​Aspire.Templates.Tests/​README.md Documents timeout behavior.
tests/​Infrastructure.Tests/​MicrosoftTestingPlatformTests.cs Tests both timeout configurations.
docs/​ci/​mtp-args-pipeline.md Updates the MTP argument pipeline documentation.

Comment thread eng/Testing.targets Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

MTP argument composition now happens in Testing.targets so project timeout
overrides are evaluated before the shared runner arguments are built.

Update workflow comments, contributor guidance, test skills, and CI docs that
still named Testing.props as the composition source. Keep Testing.props
references only where the underlying filter properties remain defined there.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

Copilot review overview

🔵 Needs a closer look

The repository-wide MTP evaluation change and official pipeline timing behavior warrant final human review despite focused regression and internal-stage validation.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@radical
Ankit Jain (radical) marked this pull request as ready for review September 24, 2026 22:03
@radical Ankit Jain (radical) changed the title Fix internal template builds timing out after dependency refresh [ci] Fix internal builds Sep 24, 2026
@JamesNK

Copy link
Copy Markdown
Member

Can anything be done to make it faster rather than increasing timeouts?

@radical

Copy link
Copy Markdown
Member Author

[automated] Superseded by #20455, which preserves this diff on an upstream branch so #20455 and #20308 can use GitHub's native stacking feature.

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

Labels

area-engineering-systems infrastructure helix infra engineering repo stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants