Skip to content

test(android): poll for stale TLS probe cleanup in auth test#83826

Merged
steipete merged 2 commits into
openclaw:mainfrom
NeatGuyCoding:fix-test-stale-TLS-probe-cleanup
Jul 2, 2026
Merged

test(android): poll for stale TLS probe cleanup in auth test#83826
steipete merged 2 commits into
openclaw:mainfrom
NeatGuyCoding:fix-test-stale-TLS-probe-cleanup

Conversation

@NeatGuyCoding

@NeatGuyCoding NeatGuyCoding commented May 19, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

GatewayBootstrapAuthTest.connect_ignoresStaleTlsProbeAfterDisconnect used a fixed 100 ms delay before checking that a completed TLS probe could not restore stale connection state. That timing assumption made the test vulnerable to scheduler and runner load.

Why This Change Was Made

The final test snapshots the runtime scope's existing child jobs, starts the delayed TLS probe, identifies the single newly created probe job, and joins that exact job after disconnecting and completing the probe. Assertions therefore run only after the stale-attempt guard has executed, without a production-only test seam or a poll on fields that disconnect() clears synchronously.

User Impact

No runtime behavior change. This makes the Android TLS recovery regression test deterministic and reduces CI flakiness.

Evidence

  • GatewayBootstrapAuthTest: 21 tests passed, 0 failures.
  • Android ktlint passed.
  • git diff --check passed.
  • Fresh exact-tree autoreview: no actionable findings, 0.97 confidence.
  • Exact-head hosted CI: 18 passed, 23 intentionally skipped, 0 failed on a6c794e218b1b4c0b626c46de685e6f596a16abc.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 2:25 AM ET / 06:25 UTC.

Summary
The PR changes one Android Robolectric auth test to poll for stale TLS probe cleanup instead of sleeping for a fixed 100 ms.

PR surface: Other +16. Total +16 across 1 file.

Reproducibility: no. I did not establish a high-confidence flaky failure against current main. Source inspection shows current main still uses a fixed post-disconnect sleep around an async TLS probe, so the flake claim is plausible but not directly reproduced.

Review metrics: none identified.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Change the wait so it proves the completed stale TLS probe coroutine has resumed or been skipped before assertions.
  • [P1] Add redacted after-fix Robolectric output, a terminal screenshot, log, recording, copied live output, or linked artifact to the PR body.
  • [P1] Refresh the branch against current main so Dependency Guard and required checks can evaluate the current head.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body lists a focused command but does not include redacted after-fix output, terminal screenshot, log, recording, copied live output, or linked artifact; private details should be redacted before posting proof and updating the PR body should trigger a fresh review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The new polling condition can pass immediately because disconnect already clears pendingGatewayTrust and desired connection state, so the test may still miss a later stale TLS probe write.
  • [P1] The external contributor proof gate is still missing redacted after-fix output, a terminal screenshot, log, recording, copied live output, or linked artifact.
  • [P1] A maintainer noted that the branch needs an update against current main before the new Dependency Guard requirement can be evaluated.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the PR focused on this Android test, but wait on stale TLS probe coroutine completion or an explicit skipped-stale-attempt signal before final assertions, then add redacted after-fix Robolectric proof.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Human follow-up is needed because the wait shape needs correction and the external proof gate requires contributor-supplied real behavior evidence before merge.

Security
Cleared: The diff is limited to one Android unit test and does not add dependencies, scripts, permissions, secrets handling, generated code, or package metadata.

Review findings

  • [P2] Wait for the stale probe coroutine before passing — apps/android/app/src/test/java/ai/openclaw/app/GatewayBootstrapAuthTest.kt:253-256
Review details

Best possible solution:

Keep the PR focused on this Android test, but wait on stale TLS probe coroutine completion or an explicit skipped-stale-attempt signal before final assertions, then add redacted after-fix Robolectric proof.

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

No, I did not establish a high-confidence flaky failure against current main. Source inspection shows current main still uses a fixed post-disconnect sleep around an async TLS probe, so the flake claim is plausible but not directly reproduced.

Is this the best way to solve the issue?

No. Polling null pending trust and desired bootstrap state is not the best fix because disconnect clears those values synchronously; the test should wait on a barrier tied to the stale probe coroutine being consumed or skipped.

Full review comments:

  • [P2] Wait for the stale probe coroutine before passing — apps/android/app/src/test/java/ai/openclaw/app/GatewayBootstrapAuthTest.kt:253-256
    After runtime.disconnect(), pendingGatewayTrust and the node-session desired connection are already cleared synchronously, so this loop can mark success before the completed TLS probe coroutine resumes and hits the stale-attempt guard. Tie the wait to the stale probe coroutine completing or being skipped before the final assertions, or the test can still miss a later stale write.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is a low-risk Android test-only flake mitigation with no production runtime, config, migration, or user-facing behavior change.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists a focused command but does not include redacted after-fix output, terminal screenshot, log, recording, copied live output, or linked artifact; private details should be redacted before posting proof and updating the PR body should trigger a fresh review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Other +16. Total +16 across 1 file.

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

What I checked:

Likely related people:

  • sliekens: Authored the merged Android changed-TLS-thumbprint work that added the stale TLS probe coverage this PR edits. (role: TLS prompt feature author; confidence: high; commits: 848e0486b77e, e7d4df33ba1b; files: apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt, apps/android/app/src/test/java/ai/openclaw/app/GatewayBootstrapAuthTest.kt)
  • obviyus: Merged the changed-TLS-thumbprint PR and authored the follow-up refactor that distilled the TLS fingerprint prompt flow. (role: feature merger and adjacent refactor author; confidence: high; commits: 848e0486b77e, 67a65c45b252, 989e53c20d39; files: apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt, apps/android/app/src/test/java/ai/openclaw/app/GatewayBootstrapAuthTest.kt)
  • joshavant: Recently merged Android TLS fingerprint timeout handling that touched NodeRuntime, GatewayTls, and GatewayBootstrapAuthTest on current main. (role: recent Android TLS area contributor; confidence: medium; commits: 21d1e1f0fc9d; files: apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt, apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayTls.kt, apps/android/app/src/test/java/ai/openclaw/app/GatewayBootstrapAuthTest.kt)
  • vincentkoc: Recently refactored Android auth-resolution coverage in the same test file and adjacent NodeRuntime helpers. (role: recent Android auth test contributor; confidence: medium; commits: 88c3bb539189; files: apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt, apps/android/app/src/test/java/ai/openclaw/app/GatewayBootstrapAuthTest.kt)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels May 19, 2026
@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

NeatGuyCoding and others added 2 commits July 2, 2026 15:01
Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
Co-authored-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
@steipete
steipete force-pushed the fix-test-stale-TLS-probe-cleanup branch from 6d6b077 to a6c794e Compare July 2, 2026 14:07
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 2, 2026
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Land-ready proof for exact head a6c794e218b1b4c0b626c46de685e6f596a16abc:

  • Rebased onto current main; final diff is one Android test file, +15/-1.
  • The submitted null-state poll could pass immediately because disconnect() clears those fields synchronously. The final test instead identifies and joins the exact TLS probe coroutine before checking that its stale completion did not restore state.
  • Focused GatewayBootstrapAuthTest: 21 passed, 0 failed.
  • Android ktlint and git diff --check: passed.
  • Fresh exact-tree autoreview: no actionable findings, 0.97 confidence.
  • Hosted exact-head checks: 18 passed, 23 intentionally skipped, 0 failed. Android Play build, Play tests, and third-party tests all passed in Actions run 28596400274; the refreshed evidence gate passed in run 28596548199.

Proof gap: no emulator screenshot is applicable because this is a test-only synchronization change with no runtime/UI behavior.

@steipete
steipete merged commit 76ccd17 into openclaw:main Jul 2, 2026
63 of 65 checks passed
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

LeonidasLux pushed a commit to LeonidasLux/openclaw that referenced this pull request Jul 3, 2026
…w#83826)

* test(android): poll for stale TLS probe cleanup in auth test

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>

* test(android): await stale TLS probe job

Co-authored-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>

---------

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 3, 2026
…w#83826)

* test(android): poll for stale TLS probe cleanup in auth test

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>

* test(android): await stale TLS probe job

Co-authored-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>

---------

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants