Investigates Helix test failures from AzDO build legs by downloading console logs, comparing passing vs failing runs, and identifying machine-specific issues. Handles XHarness timeouts, Android device errors, and bulk failure aggregation.
Ships in dotnet-helix. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Deep-dive into Helix test failures starting from an AzDO build leg. Goes beyond CI status checks to download raw console logs, compare passing vs failing runs, and identify root causes at the machine/device level.
curl for downloading raw log files when MCP search is insufficienthttps://helix.dot.net/ API endpointsGiven an AzDO build URL or pipeline definition + build ID:
HelixJobId in record properties or Helix URLs in the log outputAzDO Build → Timeline API → Failing job record → Helix job ID
⚠️ AzDO MCP tools may become unavailable mid-session. Fall back to the REST API:
https://dev.azure.com/{org}/{project}/_apis/build/builds/{buildId}/timeline?api-version=7.1
Query the Helix job for its work items. Each work item is a test group that ran on a specific machine.
Key fields to capture per work item:
iOS.CoreCLR.R2R.Test, System.Runtime.Tests)DNCENGMAC036, DNCENGTVOS-106)Crash, InfrastructureError, etc.The Helix console log URL pattern:
https://helix.dot.net/api/2019-06-17/jobs/{jobId}/workitems/{workItemName}/console
Download with curl for local analysis — this is often more reliable than Helix MCP search tools for finding specific patterns:
curl -s "https://helix.dot.net/api/2019-06-17/jobs/{jobId}/workitems/{workItemName}/console" > /tmp/{jobIdPrefix}-console.log
Also check for additional log files (test output, device logs):
https://helix.dot.net/api/2019-06-17/jobs/{jobId}/workitems/{workItemName}/files
testResults.xml: Many work items produce xUnit/NUnit result XML. Download it for structured failure data — test names, failure messages, stack traces, and pass/fail counts — especially when console logs lack detail:
# List files to find the results XML
curl -s "https://helix.dot.net/api/2019-06-17/jobs/{jobId}/workitems/{workItemName}/files" | python3 -c "import sys,json; [print(f['Name']) for f in json.load(sys.stdin)]"
# Download (path varies: testResults.xml, xharness-output/testResults.xml, etc.)
curl -sL "https://helix.dot.net/api/2019-06-17/jobs/{jobId}/workitems/{workItemName}/files/{fileName}" > /tmp/test-results.xml
# Quick failure summary
grep -c 'result="Fail"' /tmp/test-results.xml
grep 'result="Fail"' -A5 /tmp/test-results.xml | grep 'name='
💡 Helix MCP search tools (
hlx_search_log,hlx_search_file) may miss patterns — they can be case-sensitive or have limited regex support. When searching for specific strings, download the file and use localgrepfor reliability.
Look for these key patterns in order:
apple run with flags), app launch, test outputWORKLOAD TIMED OUT, exit_code=, Command exited withCommon failure signatures:
| Pattern | Meaning |
|---|---|
exit_code=143 + WORKLOAD TIMED OUT | Helix killed the process after timeout (SIGTERM) |
exit_code=71 | Infrastructure error |
exit_code=81 / DEVICE_NOT_FOUND | Android emulator not running or not responding |
exit_code=80 / APP_CRASH | XHarness device error — may be false (see below) |
Run timed out after N seconds | XHarness hit its own timeout before Helix |
TIMED_OUT (XHarness) | XHarness-level timeout (distinct from Helix timeout) |
mlaunch exited with {code} | App completed — check if XHarness noticed |
Detected test end tag then APP_CRASH | False failure — tests passed but device communication failed afterward |
Mercury error 1000 / RSD error 0xE8000003 | devicectl file copy failure (tvOS/iOS) |
| Device log file empty/removed | Device communication issue (tvOS/iOS) |
emulator-5554 found but not emulator-5556 | Wrong emulator architecture booted |
Attempt.3 in work item name | All retries exhausted |
Expected 0 exit code but got 1 (dotnet build) | SDK/MSBuild build failure — 100% fail rate, not a test bug |
System.TimeoutException: Timeout 30000ms exceeded | Playwright browser automation timeout (Blazor) |
exit_code=133 (128+5=SIGTRAP) + ASSERT FAILED | Runtime assertion failure / core dump — every test suite crashes |
⚠️ False failure detection is critical. XHarness can report APP_CRASH (exit 80) or TIMED_OUT (exit 143) even when all tests pass. Always check for
"Detected test end tag"or"Test run completed"in the log before trusting the exit code. If tests completed successfully but XHarness still reports failure, the issue is post-completion device communication, not a test bug.
This is the highest-value step for intermittent failures. Find a passing run of the same work item and download its console log too.
Compare side-by-side:
Use a SQL table to track findings across multiple runs:
CREATE TABLE helix_runs (
job_id TEXT, work_item TEXT, machine TEXT, exit_code INT,
duration_sec INT, queue TEXT, os_version TEXT, passed BOOLEAN,
notes TEXT
);
Common root cause categories:
| Category | Signal | Action |
|---|---|---|
| False failure | Tests pass ("Test run completed") but exit 80/143 reported | Device communication failed post-completion — file/update on dotnet/xharness |
| Machine-specific | Same test, same code, different outcomes by machine | Report machine name, suggest pool removal |
| Device communication | Empty device logs, log stream hangs, Mercury error 1000, RSD error 0xE8000003 | USB/connectivity issue on host |
| Emulator failure | DEVICE_NOT_FOUND (exit 81), wrong emulator arch | Systemic if spread across machines; file on dotnet/xharness for recovery logic |
| Test infrastructure | XHarness/Helix wrapper bug | File issue on dotnet/xharness or dotnet/arcade |
| Deterministic test bug | 100% failure rate, same assertion, every run | Test expectation is wrong, not infra — file on dotnet/runtime, check for blocking-clean-ci label |
| Genuine test failure | Test code exercises broken runtime behavior | File issue on dotnet/runtime |
| Timeout misconfiguration | Test passes but harness timeout too short | Adjust timeout parameter |
| Retry exhaustion | Attempt.3 still failing, retries hit same broken machine | Helix retries on same machine before reboot takes effect |
| XML truncation | All tests pass but app killed mid-result-write → truncated XML → crash reported | Large test suites on constrained devices (tvOS memory limits) |
| SDK/build break | dotnet build exit 1, 100% fail rate, error in SDK targets | Not a test bug — file on dotnet/aspnetcore or dotnet/sdk |
| Browser automation | Playwright timeout on UI element, app builds fine | Resource contention or Blazor rendering regression |
| Poison PR | Exit 133 (SIGTRAP), ALL suites fail on same build, 1x per platform per suite | Runtime assertion failure — single bad commit crashes before tests run. Filter out this build; failures are misleading |
Provide:
When a PR is merged to fix a test failure, verify it's working by checking builds queued after the merge — not builds that finished after it.
A build queued 10 minutes before a PR merges runs against the old source, even if it finishes hours later. Only builds queued after the merge include the fix.
gh pr view {number} --repo {owner/repo} --json mergedAt⚠️ Common mistake: Seeing a failure "after the merge" and concluding the fix didn't work. Always check queue time — the build may have started before the merge landed.
When queue time is ambiguous (merge happened mid-build), use commit ancestry:
gh api repos/{owner}/{repo}/compare/{merge_commit}...{build_source_version} --jq '.status'
# "ahead" or "identical" = fix is included; "behind" = fix is NOT included
When the user asks "what are the top N failures" across a pipeline or time range, use a different approach than single-build investigation.
CREATE TABLE failure_survey (
build_id INT, leg TEXT, work_item TEXT, exit_code INT,
machine TEXT, failure_category TEXT, helix_job TEXT,
is_pr_specific BOOLEAN, notes TEXT
);
| Type | Signal | Priority |
|---|---|---|
| Recurring test failure | Same work item fails across many PRs | High — investigate root cause |
| PR-specific build error | Multiple legs fail on same build only | Low — PR author's problem |
| Poison PR | ALL suites fail on one build, exit 133, 1x per platform | Low — filter out; single bad commit crashes runtime before tests run |
| Infrastructure error | exit 71, exit 81, DEVICE_NOT_FOUND | Medium — systemic infra issue |
| Sporadic infra | Single occurrence, no pattern | Ignore — noise |
When assessing main branch health, filter to rolling (scheduled) builds using reasonFilter=schedule. PR builds include broken PR branches that dominate failure counts and obscure systemic issues.
Real-world example: over the same 2-day window, PR builds produced 423 work item failures (dominated by a single poison PR with 119 failures). Rolling builds had only 46 failures — all genuine systemic issues.
# Rolling builds only (scheduled, typically 2x daily on main)
curl -s "https://dev.azure.com/{org}/{project}/_apis/build/builds?definitions={defId}&reasonFilter=schedule&resultFilter=failed&minTime={iso8601}&$top=50&api-version=7.1"
Use rolling builds to:
Some tests fail on multiple platforms. When reporting top-N, group by test name but break out by leg to show which platforms are affected:
System.Runtime.Tests: 61 total
→ ios-arm64 Mono (13), tvos-arm64 Mono (20), android (9), ...
This reveals whether a failure is platform-specific or cross-platform.
After identifying a recurring failure, determine whether it's machine-specific or systemic:
| Distribution | Diagnosis | Action |
|---|---|---|
| 1-2 machines account for most failures | Machine-specific — hardware/config issue | Report machines, suggest pool removal |
| Failures spread evenly across many machines | Systemic — software/infra issue | File infrastructure bug |
| Slight concentration on a few + spread | Mixed — systemic with some worse machines | File bug + flag worst offenders |
Example from real investigation: tvOS failures concentrated on DNCENGTVOS-036 and DNCENGTVOS-022 = machine-specific. Android DEVICE_NOT_FOUND spread across 17 machines = systemic emulator issue.
When investigation reveals a clear root cause, file issues on the appropriate repo:
| Root Cause | File On | Include |
|---|---|---|
| XHarness bug (timeout handling, exit code detection, device recovery) | dotnet/xharness | Pass/fail comparison evidence, console log URLs, affected machines |
| Helix infrastructure (retry behavior, machine management) | dotnet/arcade or dnceng issue tracker | Failure counts, machine distribution, retry logs |
| Test code bug | dotnet/runtime | Failing test name, stack trace, repro steps |
| Machine hardware | dnceng infrastructure team | Machine names, failure frequency, environment details |
Always include:
🚨 Don't rely solely on Helix MCP search tools for log analysis. Download the console log with curl and use local grep — it's faster and more reliable for pattern matching.
🚨 Don't assume "flaky" without evidence. If the same machine fails every time, it's machine-specific, not flaky. Capture the machine name.
🚨 Don't ignore the "Exit code detection" warning as the root cause. On tvOS/iOS 15+, XHarness logs this warning but it may be a red herring — the real issue can be device log streaming, not exit code detection itself.
🚨 Don't analyze all builds in a pipeline. Filter to the specific job/leg first, then look at 3-5 recent runs maximum.
| Queue Pattern | Platform |
|---|---|
osx.*.amd64.appletv.open | Apple TV devices (tvOS) |
osx.*.amd64.iphone.open | iPhone devices (iOS) |
ubuntu.*.amd64.android.*.open | Android emulators |
ubuntu.* | Linux |
windows.* | Windows |
browser-wasm.* | WASM (Chrome/Firefox) |
Queue name is in the first line of every Helix console log: workitem ... ({queue}) executed on machine {machine}.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/dotnet-helix:helix-investigationfrom dotnet-helix
npx claudepluginhub dotnet/arcade-skills --plugin dotnet-helix4 skills in this plugin
/ci-analysisAnalyze CI build and test status from Azure DevOps and Helix for dotnet repository PRs. Use when checking CI status, investigating failures, determining if a PR is ready to merge, or given URLs containing dev.azure.com or helix.dot.net. Also use when asked "why is CI red", "test failures", "retry CI", "rerun tests", "is CI green", "build failed", "checks failing", or "flaky tests". DO NOT USE FOR: investigating stale codeflow PRs or dependency update health, tracing whether a commit has flowed from one repo to another, reviewing code changes for correctness or style.
/ci-crash-dumpDownload and debug crash dumps from CI test failures in dotnet repositories. Use when a CI test crashed (not just failed), when the user wants to debug a crash dump from a PR or build, or when asked "debug dump", "download dump", "crash dump from CI", "test crashed", "analyze crash in PR", or "why did the test crash". DO NOT USE FOR: test failures that are not crashes (use ci-analysis), build failures, performance analysis, or analyzing dumps you already have locally.
/pipeline-investigationInvestigate AzDO pipeline failures beyond Helix — build errors, infra tooling crashes, validation test flakiness, artifact cascade failures. USE FOR: "why did the unified-build fail", "what's breaking the pipeline", "how often does this failure occur", "drill into build task logs", "1ES scan failures", "SourcelinkTests flaky", "NetAnalyzers build error", analyzing AzDO build timelines and task logs, failure frequency/trend analysis. DO NOT USE FOR: Helix test failures (use helix-investigation), CI status overview (use ci-analysis), codeflow PRs (use flow-analysis). INVOKES: AzDO, Helix, and binlog MCP tools, az CLI for internal auth, gh CLI.
Other plugins' skills for the same job