Skip to content

Wait for emulator boot before running instrumented tests - #662

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/fix-instrumented-emulator-boot-race
Oct 19, 2026
Merged

0xnm merged 1 commit into
developfrom
nogorodnikov/fix-instrumented-emulator-boot-race

Conversation

@0xnm

@0xnm 0xnm commented Oct 19, 2026

Copy link
Copy Markdown
Member

What does this PR do?

The emulator was started in the background and connectedDebugAndroidTest ran immediately, relying on the Gradle build taking longer than the boot. With build caching enabled the build often finishes first, and APK installation fails with "Can't find service: package".

Build the APKs while the emulator boots, then poll sys.boot_completed (up to 300s) before running the connected tests.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

The emulator was started in the background and connectedDebugAndroidTest
ran immediately, relying on the Gradle build taking longer than the boot.
With build caching enabled the build often finishes first, and APK
installation fails with "Can't find service: package".

Build the APKs while the emulator boots, then poll sys.boot_completed
(up to 300s) before running the connected tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 64.18% (-0.25%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f5dccc5 | Docs | Give us feedback!

@0xnm
0xnm marked this pull request as ready for review October 19, 2026 08:21
@0xnm
0xnm requested review from a team as code owners October 19, 2026 08:21
@0xnm 0xnm added the ready-for-human-review Pull Request is ready for the human review, all agentic feedback is addressed. label Oct 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T08:23:24.806189Z f5dccc5 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-19T08:24:18.623266Z f5dccc5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The boot-completion gate addresses the APK installation race while preserving build, timeout, and test failure propagation. Actual Android emulator execution remains unvalidated.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit f5dccc5

@0xnm
0xnm merged commit 5c7ed35 into develop Oct 19, 2026
18 checks passed
@0xnm
0xnm deleted the nogorodnikov/fix-instrumented-emulator-boot-race branch October 19, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human-review Pull Request is ready for the human review, all agentic feedback is addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants