test(cloudxr): real-browser run_oob_connect() tests against MockCloudXR, with anticipatory reliability-branch coverage - #1148
Draft
gareth-morgan-nv wants to merge 6 commits into
Draft
gareth-morgan-nv wants to merge 6 commits into
gareth-morgan-nv wants to merge 6 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
gareth-morgan-nv
marked this pull request as draft
September 29, 2026 14:43
gareth-morgan-nv
force-pushed
the
gmorgan/MockADB
branch
from
September 30, 2026 15:16
48d0b30 to
5954078
Compare
gareth-morgan-nv
force-pushed
the
gmorgan/oob-connect-tests
branch
from
September 30, 2026 15:18
861f8eb to
55922d6
Compare
…p_tabs Adds coverage for the "stale-tab" state from the web-client UI-state reliability backlog on the host-orchestration side (oob_teleop_adb.py), following up on the client-side coverage in #1136/#1137. _discover_devtools_socket's candidate-matching and priority logic is exercised via mocked _run_adb output. _close_stale_teleop_tabs is driven against a real local HTTP server standing in for Chromium's CDP /json endpoint (only the adb forward/remove calls either side are mocked, since there's no real device here), so the oobEnable= tab-matching and close-request logic itself is exercised for real rather than asserted via mocked call arguments. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
…diness poll Extends the fake-CDP pattern from the stale-tab tests to a WebSocket responder (_CdpScript/_fake_cdp_ws), since _cdp_session_click_connect speaks CDP entirely over one WebSocket rather than the HTTP /json endpoint _close_stale_teleop_tabs uses. Covers the remaining two named states from the web-client UI-state reliability backlog that are host-side (oob_teleop_adb.py), completing the follow-up from #1136/#1137: - certificate: both bypass layers - primary (Page.navigate re-navigate) and DOM fallback (details-button -> proceed-link click-through, forced by a chrome-error: interstitial URL, the same branch condition the real function checks). - browser-launched-but-client-not-loaded (host-side half; the client-side half is in #1137): the #startButton readiness-poll state machine's ready path (multi-step initializing -> ready) and failed path (raises OobAdbError before ever dispatching a click). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
CodeRabbit review on #1138: server.shutdown() stops serve_forever() but doesn't close the listening socket - only server_close() does. The port is a hardcoded constant (_CDP_LOCAL_PORT, since _close_stale_teleop_tabs hardcodes it internally) reused across multiple tests in this file, so relying on garbage collection to eventually release it risks a delayed- release port conflict between tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
Cover the real run_oob_connect() against a fake adb (mock_adb) and a fake CDP tab-list server: successful launch through to monitor task creation, plus the no-devtools-socket, am-start-failure, and no-matching-tab error paths. Signed-off-by: Gareth Morgan <gmorgan@nvidia.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
…owser integration test Drive the real run_oob_connect() against a real Chromium running the real webxr client (real IWER-emulated WebXR, real CDP), a real wss.py proxy (real OOBControlHub, no real CloudXR runtime behind it), and a RealBrowserAdb whose am start/adb forward have real side effects instead of canned output. Only adb itself stays faked, since no physical Android device is available. A minimal_mock_runtime() stand-in on backend_port is needed: without something listening there, the real client's signaling handshake gets torn down by wss.py's proxy_handler() right after connecting, which surfaces as a real error banner and makes run_oob_connect() raise instead of returning a monitor task. The stand-in speaks none of the real CloudXR/WebRTC protocol - it only avoids that specific failure mode. Design and inventory captured in oob-real-browser-integration-test-plan.md. Manual-run only for now; not yet wired into CI. Signed-off-by: Gareth Morgan <gmorgan@nvidia.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
… builds, add crash/relaunch coverage Switch every real-browser test from the real @nvidia/cloudxr SDK to MockCloudXR (npm run build:app-mock): the real SDK genuinely tries to stream against whatever's on backend_port, which is unpredictable and gives a test nothing to assert against. MockCloudXR mounts the identical App.tsx/CloudXRComponent.tsx UI with a fully deterministic, externally controllable session, and never opens a socket of its own, so minimal_mock_runtime() is gone entirely. Switch from a dev-server to a static production build (static_webxr_build()). Two real bugs made this necessary: webpack HMR re-executes a module's top-level code on live-reload, creating a second, disconnected instance of cloudxr-mock-alias.ts's activeSession that window.__mockCloudXRFail() silently bound to instead of the real running session; and <React.StrictMode> (present regardless of HMR) double-invokes effects in a dev-mode build, calling CloudXR.createSession() twice for the same reason. webpack.app-mock.js now builds in production mode. Along the way, a stale webpack persistent filesystem cache (keyed only on the config file, not source files) was found silently serving an old compiled bundle; static_webxr_build() now clears it before every build. window.__mockCloudXRFail() gains an optional `code` param: a code-less failure is "recoverable" per isRecoverable(), and CloudXRComponent.tsx auto-reconnects on those without ever showing the error banner, so forcing a real terminal error needs a code in the non-retryable range. Add two new real-browser tests: one proving the crash-trigger mechanism itself (a real, deterministic, DOM-visible error banner on demand), and one anticipatory test written against gmorgan/oob-error-relaunch (#1146) before that branch has merged here - it asserts on black-box observable recovery (a second real `am start`, a second real tab) rather than importing any private function, so it fails cleanly on that assertion today and should turn green once #1146 lands. Also add test_build_teleop_url_forwards_reliability_config_from_env, the same "write it now, let it fail until merged" idea applied to gmorgan/oob-reliability-config-wiring (#1145)'s plain env-var/string forwarding - no browser needed for that one. Signed-off-by: Gareth Morgan <gmorgan@nvidia.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
gareth-morgan-nv
force-pushed
the
gmorgan/oob-connect-tests
branch
from
September 30, 2026 16:18
55922d6 to
3e68d67
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_oob_connect(), standardized on MockCloudXR (npm run build:app-mock) rather than the real@nvidia/cloudxrSDK: the real SDK genuinely tries to stream against whatever's onbackend_port, which is unpredictable and gives a test nothing to assert against. MockCloudXR mounts the identicalApp.tsx/CloudXRComponent.tsxUI with a fully deterministic, externally controllable session (window.__mockCloudXRFail(message?, code?)), and never opens a socket of its own.static_webxr_build()). Two real bugs made this necessary: webpack HMR duplicating thecloudxr-mock-alias.tsmodule instance (so the crash-trigger silently bound to an empty session), and<React.StrictMode>double-invokingCloudXR.createSession()in a dev-mode build.webpack.app-mock.jsnow builds in production mode. Also found and fixed: a stale webpack persistent filesystem cache silently serving an old bundle — cleared before every build now.gmorgan/oob-error-relaunch(cloudxr: auto-relaunch the teleop tab on a terminal client error (depends on #1138, #1145) #1146) before it's merged here — asserts on black-box observable recovery (a second realam start, a second real tab), so it fails cleanly today and should turn green once cloudxr: auto-relaunch the teleop tab on a terminal client error (depends on #1138, #1145) #1146 lands.test_build_teleop_url_forwards_reliability_config_from_env, the same "write it now, let it fail until merged" approach applied togmorgan/oob-reliability-config-wiring(cloudxr: wire client reconnect/warm-up-timeout config through OOB launch #1145)'s config forwarding — no browser needed for that one.oob-real-browser-integration-test-plan.md(repo root, §8 has the final-state summary).gmorgan/MockADB(test(cloudxr): reusable fake-adb test double (FakeAdb/mock_adb) #1147) forFakeAdb/mock_adb()— base branch unchanged.Test plan
uv run pytest test_oob_teleop_adb.py test_oob_teleop_env.py test_oob_teleop_hub.py test_fake_adb.py test_wss_static_client.py -q— 141 passed, 2 expected anticipatory failures (config-wiring, auto-relaunch — both intentionally fail until their respective branches merge)SKIP=check-copyright-year pre-commit runon all changed files — cleannpx eslint/npx prettier --checkon changed TS files — clean🤖 Generated with Claude Code