Skip to content

fix(android): drain Wear fixtures before speech shutdown - #172452

Merged
steipete merged 1 commit into
mainfrom
solid2/hf-android-wear
Oct 14, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/hf-android-wear

Conversation

@steipete

@steipete steipete commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes intermittent Android Wear CI failures when a chat-flow fixture drains the speech Looper after disposing its activity.

Related: #172147. Scheduled main run 38599255839, android-test-wear failed in WearChatEventFlowTest.repeatedAbortPreservesAnAcceptedSessionWideCancellation (1 of 348 tests). Its XML stack is Flow.close → Flow.idle → ShadowPausedLooper.idle → LooperControlService.executeControlTask; the Looper control service was already shut down while the thread still appeared alive.

User Impact

No production behavior changes. The asynchronous TTS lifecycle that prevents Wear UI freezes remains intact.

Why This Change Was Made

Drain UI/speech work before activity disposal. After disposal, drain only the main Looper for UI cleanup instead of submitting control work to an exiting speech Looper. Keep the active test's two-way drain and all assertions unchanged.

Evidence

Check Result
Scheduled main failure Exact case and teardown stack confirmed from job log and XML artifact
Local unchanged main, 103 flow tests Passed; the intermittent failure did not reproduce locally (cold build 27m55s; tests 455.237s)
Fixed run 1 103 flow tests + 4 speech lifecycle tests + blocked-engine responsiveness regression passed (298.75s wall)
Fixed run 2 103 flow tests passed (195.69s wall)
Fixed run 3 103 flow tests passed (148.36s wall)
Wear ktlint Passed (31.49s wall)
Integrated with current main (179b5d4bc211) Original cancellation case + voice-submission case passed (87.17s wall)
Current PR CI Run 38622841278 passed for 51012f799ef1; Wear flow class: 103 passed, 25.014s; original failing case passed, 1.214s
Independent autoreview, P2 Clean; no actionable findings

Test-only diff: 4 lines added, 1 removed; affected file 3,133 → 3,136 lines. No rendered UI or startup bundle change, so screenshots and UI startup measurements do not apply. No remote test lease used.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Contributor

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-14T19:23:04.966298Z 51012f7 New commits
ℹ️ 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.

Drain the active UI and speech queues before disposing the activity, then flush only main-thread cleanup. Robolectric can mark the speech Looper shutdown while its HandlerThread is still alive, so the post-disposal all-Looper drain races teardown. Preserve the asynchronous TTS lifecycle from #172147.
@steipete
steipete force-pushed the solid2/hf-android-wear branch from 179b5d4 to 51012f7 Compare October 14, 2026 19:20
@steipete
steipete merged commit 7367b5b into main Oct 14, 2026
79 checks passed
@steipete
steipete deleted the solid2/hf-android-wear branch October 14, 2026 22:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…2452)

Drain the active UI and speech queues before disposing the activity, then flush only main-thread cleanup. Robolectric can mark the speech Looper shutdown while its HandlerThread is still alive, so the post-disposal all-Looper drain races teardown. Preserve the asynchronous TTS lifecycle from openclaw#172147.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant