Skip to content

[ci] Diagnose logcat capture failures and retry the task once - #12744

Merged
jonathanpeppers merged 4 commits into
dotnet:mainfrom
mmitche:mmitche-microsoft-logcat-capture-diagnostics
Sep 10, 2026
Merged

jonathanpeppers merged 4 commits into
dotnet:mainfrom
mmitche:mmitche-microsoft-logcat-capture-diagnostics

Conversation

@mmitche

@mmitche mmitche commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Add basic logcat capture diagnostics and try one task-level retry to see whether it reduces intermittent capture failures. This should provide more information than a task timeout alone; whether the retry helps remains to be observed in CI.

Keep capture inline in the instrumentation YAML, logging timestamps, elapsed time, exit codes, output size, and narrowly scoped adb client tracing. Bound capture to 45 seconds so a hang returns a failure before the outer task timeout, allowing Azure to retry once within a two-minute task budget.

Keep the existing logcat artifact path, no-device skip behavior, artifact upload policy, and final failure handling.

mmitche and others added 2 commits September 8, 2026 12:59
Bound adb capture before Azure task cancellation, preserve per-attempt diagnostics, and retain result uploads after a recovered capture failure.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore the existing artifact upload policy and remove the standalone helper and tests. Keep basic console diagnostics and a bounded capture for the task-level retry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mmitche
mmitche marked this pull request as ready for review September 9, 2026 20:03
Copilot AI lite review requested due to automatic review settings September 9, 2026 20:03

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.

🟡 Changes recommended

The updated logcat capture script exits before printing the saved adb devices discovery output to the task log on failures due to set -e, reducing diagnostics when capture is most needed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the APK instrumentation pipeline template to make logcat capture more diagnosable and resilient to intermittent hangs by adding inline capture diagnostics and enabling a single Azure task-level retry.

Changes:

  • Replace the previous best-effort adb devices/adb logcat capture with a time-bounded helper that logs timestamps, exit codes, and output byte counts.
  • Persist adb devices output alongside the captured logcat file and add a hard 45s shared deadline to allow task-level retry.
  • Increase the step timeout to 2 minutes and enable retryCountOnTaskFailure: 1.
File summaries
File Description
build-tools/automation/yaml-templates/apk-instrumentation.yaml Adds inline, time-bounded logcat capture diagnostics and enables one task-level retry for the capture step.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread build-tools/automation/yaml-templates/apk-instrumentation.yaml Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers

Copy link
Copy Markdown
Member

/review

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • azcliprod.blob.core.windows.net

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "azcliprod.blob.core.windows.net"

See Network Configuration for more information.

Generated by Android PR Reviewer for #12744

@github-actions github-actions Bot 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.

⚠️ Needs Changes — 0 errors, 1 warning, 0 suggestions.

The bounded capture and explicit adb status logging are useful improvements, and the ordinary nonzero adb devices path now prints discovery output before propagating failure. The remaining timeout path exits from inside the helper, so the diagnostic output for the hang this PR is intended to investigate can be skipped and overwritten by the retry; I left an inline comment with the requested control-flow change.

CI is still in progress for Azure DevOps build 1589763: six checks have passed, the remaining build/test matrix is running or queued, and no failed check is currently reported.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • azcliprod.blob.core.windows.net

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "azcliprod.blob.core.windows.net"

See Network Configuration for more information.

Generated by Android PR Reviewer for #12744 · copilot · gpt56 · 53.5 AIC · ⌖ 11.3 AIC · ⊞ 21K
Comment /review to run again

Comment thread build-tools/automation/yaml-templates/apk-instrumentation.yaml Outdated
Allow the caller to print partial discovery output before propagating the timeout status.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers
jonathanpeppers merged commit a735d98 into dotnet:main Sep 10, 2026
44 checks passed
simonrozsival added a commit that referenced this pull request Sep 11, 2026
Resolve the logcat capture conflict by preserving the diagnostics added in #12744 while keeping capture-only timeouts non-gating.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

3 participants