Skip to content

Improve fix-flaky-test skill and reproduce workflow#14710

Merged
radical merged 7 commits intomainfrom
fix-flaky-test-skill
Feb 27, 2026
Merged

Improve fix-flaky-test skill and reproduce workflow#14710
radical merged 7 commits intomainfrom
fix-flaky-test-skill

Conversation

@radical
Copy link
Member

@radical radical commented Feb 26, 2026

Summary

Improves the fix-flaky-test skill, reproduce workflow, and local test scripts.

Changes

Move scripts — Move run-test-repeatedly.ps1 and run-test-repeatedly.sh from .github/workflows/fix-flaky-test/ to .github/skills/fix-flaky-test/ next to SKILL.md.

Test review guidelines — Add .github/instructions/test-review-guidelines.instructions.md with common flaky test patterns table and review checklist, registered in AGENTS.md for tests/**/*.cs.

Reproduce workflow (reproduce-flaky-tests.yml)

  • Override _NonQuarantinedTestRunAdditionalArgs to disable quarantine exclusion filter during dotnet test
  • Capture test output and detect zero-test runs (exit code 8 masked by --ignore-exit-code 8)
  • Fix pipefail: wrap dotnet test | tee with set +e / set -e so PIPESTATUS is captured correctly under GitHub Actions defaults
  • Apply same improvements to both Linux and Windows jobs

Local test scripts (run-test-repeatedly.sh, run-test-repeatedly.ps1)

  • CI vs local detection with Docker cleanup prompt
  • DCP cleanup regex fix to match bare dcp processes
  • Zero-test detection (exit code 8 masked by Testing.props)
  • Docker container/volume/network cleanup between iterations

Skill (.github/skills/fix-flaky-test/SKILL.md)

  • Two-branch workflow: investigation branch (draft PR, ci.yml disabled) for reproduce/verify; clean fix branch for final PR
  • [automated] PR prefix when no user interaction occurred
  • PR body template with skill attribution and verification table
  • Contention-sensitive test handling (quarantine-project mode)
  • Local confidence tiers to scale CI verification effort
  • Squash guidance and PR creation failure handling
  • Note explaining issue stays open after fix PR

Testing

Used this skill end-to-end to fix #13287 (PR #14708).

Copilot AI review requested due to automatic review settings February 26, 2026 01:24
@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2026

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14710

Or

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

Copy link
Contributor

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

Updates the repository’s flaky-test fixing workflow/documentation and improves the repro tooling (workflow + local scripts) to better handle common failure modes seen in quarantined/flaky test investigations.

Changes:

  • Expands the fix-flaky-test skill with a two-branch investigation/fix workflow, PR templating/attribution, and session-state tracking guidance.
  • Enhances reproduce-flaky-tests automation with zero-test-run detection and improved quarantine-filter handling.
  • Updates local repetition scripts to support optional Docker cleanup and zero-test detection; adds test review guidelines + wiring in AGENTS.md.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
run-test-repeatedly.sh Adds CI/local detection, optional Docker cleanup, zero-test detection, and adjusts DCP cleanup matching.
run-test-repeatedly.ps1 Mirrors shell script improvements for Windows/PowerShell.
.github/workflows/reproduce-flaky-tests.yml Captures test output for zero-test detection and clears quarantine exclusion during dotnet test.
.github/skills/fix-flaky-test/SKILL.md Documents a two-branch workflow, adds PR templating, and updates quarantine/zero-test guidance.
.github/instructions/test-review-guidelines.instructions.md New guidelines/checklist for reviewing tests for common flakiness patterns.
AGENTS.md Applies the new test review guidelines instructions to tests/**/*.cs.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 9588043:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AgentInitCommand_WithMalformedMcpJson_ShowsErrorAndExitsNonZero ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateStartWaitAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording

📹 Recordings uploaded automatically from CI run #22463511913

@radical radical force-pushed the fix-flaky-test-skill branch from ee2b6bc to b840081 Compare February 26, 2026 03:02
radical and others added 6 commits February 26, 2026 17:04
Move run-test-repeatedly.ps1 and run-test-repeatedly.sh from
.github/workflows/fix-flaky-test/ to .github/skills/fix-flaky-test/
next to the SKILL.md file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add .github/instructions/test-review-guidelines.instructions.md with
common flaky test patterns table and review checklist. Register it in
AGENTS.md for tests/**/*.cs files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Override _NonQuarantinedTestRunAdditionalArgs to disable quarantine
  exclusion filter during dotnet test
- Capture test output and detect zero-test runs (exit code 8 masked
  by --ignore-exit-code 8)
- Fix pipefail: wrap dotnet test | tee with set +e / set -e so
  PIPESTATUS is captured correctly under GitHub Actions defaults
- Apply same improvements to both Linux and Windows jobs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add CI vs local detection with Docker cleanup prompt
- Fix DCP cleanup regex to match bare 'dcp' processes
- Add zero-test detection (exit code 8 masked by Testing.props)
- Add Docker container/volume/network cleanup between iterations
- Update path references after move to skills directory

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add CI vs local detection with Docker cleanup prompt
- Add zero-test detection (exit code 8 masked by Testing.props)
- Add Docker container/volume cleanup between iterations
- Update path references after move to skills directory

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Restructure around two-branch workflow (investigation + clean fix)
- Add automated PR labeling with [automated] prefix
- Add PR body template with skill attribution and verification table
- Add contention-sensitive test handling (quarantine-project mode)
- Add session state tracking for investigation/fix branches
- Add local confidence tiers to scale CI verification
- Add squash guidance and PR creation failure handling
- Add note explaining issue stays open after fix PR
- Update quarantine docs to reflect build+test requirements
- Update script path references after move to skills directory

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@radical radical force-pushed the fix-flaky-test-skill branch from dd7a132 to 011c179 Compare February 26, 2026 22:05
@radical radical changed the title Improve fix-flaky-test skill: two-branch workflow, automated PR labeling Improve fix-flaky-test skill and reproduce workflow Feb 26, 2026
@radical radical marked this pull request as ready for review February 26, 2026 22:31
@radical radical added the area-engineering-systems infrastructure helix infra engineering repo stuff label Feb 26, 2026
@radical radical enabled auto-merge (squash) February 26, 2026 23:08
@radical radical merged commit 9790005 into main Feb 27, 2026
340 of 341 checks passed
@radical radical deleted the fix-flaky-test-skill branch February 27, 2026 00:38
@dotnet-policy-service dotnet-policy-service bot added this to the 13.3 milestone Feb 27, 2026
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.

Failing test: Aspire.Hosting.Azure.Tests.AzureDeployerTests.DeployAsync_WithMultipleComputeEnvironments_Works

3 participants