Skip to content

chore(android): remove idle waits from queued-action tests - #159077

Merged
steipete merged 1 commit into
mainfrom
codex/android-queued-action-test-waits
Sep 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/android-queued-action-test-waits

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Two Android service lifecycle tests each spend ten seconds waiting for a Gateway request that settled, retired activity work must never admit.

User Impact

No user-visible change. This removes approximately 20 seconds of idle waiting from each invocation of the affected test class while preserving its stale-action regression coverage.

Why This Change Was Made

The saved-Gateway and conversation-notification fixtures use cleartext connections whose session admission completes before the awaited ViewModel operation returns. Extend the existing call-through connection probe to assert that no new target was admitted after that operation settles. The probe still calls the real Gateway session implementation, and initial node/operator admissions verify that it is active.

Refresh, bootstrap promotion, and foreground-reentry retain their existing waits because their asynchronous owners do not share that settlement boundary. No production behavior, timeouts, retries, worker settings, or heap settings change.

Evidence

  • Unchanged and patched NodeForegroundServiceTest: 53/53 passed in each run using :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.NodeForegroundServiceTest.
  • The two affected cases took 20.181 seconds before → 0.093 seconds after. Observed class span was 70.454 → 47.785 seconds. Gradle wrapper wall was 135.783 → 70.320 seconds; those wrapper times include different compilation work and are not the claimed test savings. Both runs used the same supported build timestamp, two test forks, and unchanged heap settings.
  • Negative control: temporarily allowing a retired ViewModel operation through its currentness check made both changed tests fail at the intended “must not admit another Gateway connection” assertion. After restoring the original production bytes, both passed again.
  • Actual changed-file checks passed, including Android lint, formatting, and the native state schema guard. Fresh independent Codex review found no actionable findings through P2.
  • The original local full-cohort investigation passed 2,481 cases before a memory-headroom guard stopped it. That local baseline remains incomplete; the patched full third-party CI cohort subsequently passed. This test optimization does not claim to resolve the historical Android CI job timeout; the original canceled run lacked per-case/thread evidence.

CI on the published head passed both app editions, Wear tests, and lint. The third-party job JUnit report records 53/53 passing cases, 51.794 seconds for the class, with the two changed cases at 0.164 + 0.095 = 0.259 seconds. The entire job took 441 seconds; its Gradle test step took 364 seconds. These job/step durations include the other test classes and setup.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 26, 2026 17:45
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 2:31 PM ET / 18:31 UTC.

ClawSweeper review

What this changes

The Android test branch replaces two ten-second Gateway socket waits with session-admission assertions for queued saved-Gateway and conversation-notification actions.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still has the two idle waits, and the proposed assertion matches the direct cleartext admission path. I found no actionable patch defect.

Priority: P3
Reviewed head: 670047bb396188889263d7b163ee4a2d6f04691f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The narrow patch has measured test-speed evidence, a reported negative control, and passing Android CI, with no actionable finding.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The member-authored change is test-only, so the external-contributor proof gate does not apply. The PR reports real Gradle before-and-after timings, a failing negative control, and passing published-head CI for the changed test path; no stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored change is test-only, so the external-contributor proof gate does not apply. The PR reports real Gradle before-and-after timings, a failing negative control, and passing published-head CI for the changed test path; no stored-data contract changes.
Evidence reviewed 7 items Introduced test change: The pinned merge-base-to-head diff adds the session shadow to two tests and checks recorded admission after their queued operation joins.
Current main still waits: The current-main helper sends saved-Gateway and notification cases through a ten-second socket request wait.
Admission boundary: The test shadow records a GatewaySession.connect call before forwarding it to the real session; the cleartext runtime path calls session connect directly.
Findings None None.
Security None None.

How this fits together

Android’s ViewModel coordinates Gateway connections with the foreground service. These tests queue connection actions, stop the service, and check whether retired work reaches Gateway session admission.

flowchart LR
A[Gateway action] --> B[Queued ViewModel operation]
C[Service stop] --> B
B --> D[Runtime admission decision]
D --> E[Gateway session probe]
B --> F[Operation settles]
E --> G[Regression assertion]
F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 9 8 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 9 8 +1

Review metrics

Metric Value Why it matters
Two-case runtime 20.181 s → 0.093 s locally The reported before-and-after measure is the benefit of this test-only change; published-head CI also reports both cases passing.

Technical review

Best possible solution:

Keep the stale-action regression at the Gateway admission boundary and retain timed socket checks for actions whose effects can outlive the joined operation.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main still routes both cases through a ten-second request wait. The PR reports measured before-and-after runs; this read-only review did not execute them.

Is this the best way to solve the issue?

Yes. For these cleartext actions, the joined operation and call-through session probe provide a narrower check than waiting for a delayed socket request.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e67317ae3b59.

Labels

Label changes:

  • add P3: This is a bounded Android test-speed improvement with no user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored change is test-only, so the external-contributor proof gate does not apply. The PR reports real Gradle before-and-after timings, a failing negative control, and passing published-head CI for the changed test path; no stored-data contract changes.

Label justifications:

  • P3: This is a bounded Android test-speed improvement with no user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored change is test-only, so the external-contributor proof gate does not apply. The PR reports real Gradle before-and-after timings, a failing negative control, and passing published-head CI for the changed test path; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 0dee346 into main Sep 26, 2026
133 checks passed
@steipete
steipete deleted the codex/android-queued-action-test-waits branch September 26, 2026 19:20
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant