Repository navigation
fix: installed Chrome fallback, logging and candidate order (#169) - #183
chaodu-agent wants to merge 3 commits into
Conversation
…#169) Follow-up items from the #165 review that are still valid on main: - M2: a Chrome check that fails during browser use is now logged as `browser: chrome_check_failed class=<class>` (class only, no path). Before, only the consent step logged it. - M3: InstalledChromeChecker.check() walks /Applications then ~/Applications and returns the first copy that passes. If none passes, it returns the problem of the first existing copy, as before. - L1: the FakeInstallFixture default chrome checker reads no directories, so no test reads the real /Applications. - L3: the Remove copy says the installed Chrome choice is removed only when install.json is removed, matching R7.7. Tests (failing before, passing after): - testChromeProblemDuringBrowserUseIsLoggedWithItsClass - testAValidCopyInHomeApplicationsIsUsedWhenTheSystemCopyFails - testFixtureDefaultCheckerNeverReadsRealApplications (failed before on a Mac with a Chrome-named bundle in /Applications, passes after) - testRemoveCopySaysTheChoiceGoesOnlyWhenInstallJSONIsRemoved Verification on the final tree: - Swift: swift build passed. swift test: 856 executed, 5 skipped (environment-gated), 0 failures. - Rust: the repo has no root Cargo.toml. The crate under poc/ was tested with cargo test: 604 passed, 0 failed, 17 ignored. Not changed: M1 (check cost) and L2 (version shown when the check fails) are open product decisions, tracked on the issue.
|
Important CHANGES REQUESTED What This PR DoesFixes three follow-ups from #169: Chrome discovery refused a valid How It Works
Findings
Finding Details🟡 F1: arm64 Rust test failure on the reviewed head
🟢 F2: Candidate orderThe old code took the first existing bundle and stopped there. The new loop matches the intended priority semantics without changing the public API. The new test covers both branches: a valid home copy is used when the system copy fails, and with no valid copy the class from the first existing copy ( Two notes, not blocking:
🟢 F3: Call-time loggingThe 🟢 F4: Fixture isolation
🟢 F5: Removal copyThe test asserts the new wording is present and the old wording is gone. Baseline Check
Three Reasons We Might Not Need This PR
None of these outweighs fixing a real refusal of a valid Chrome copy. What's Good (🟢)
|
- InstalledChromeChecking.check() doc comment now describes the rule: the first allowed copy that passes, else the first existing copy's problem. - testAValidCopyInHomeApplicationsIsUsedWhenTheSystemCopyFails gives the two copies different failure classes (system copy too old, ~/Applications copy bad signature) and asserts the system copy's class is reported, so the priority order is pinned. - BrowserWizardWiringTests uses /home/example as the home path. Failing before, passing after (base sources with the new tests): - testChromeProblemDuringBrowserUseIsLoggedWithItsClass: fails, no log line. - testAValidCopyInHomeApplicationsIsUsedWhenTheSystemCopyFails: fails, returns invalidSignature. - testFixtureDefaultCheckerNeverReadsRealApplications: fails on the test host only when a Chrome-named bundle is present in /Applications. A temporary stand-in bundle reproduced that, and it was removed afterward. - testRemoveCopySaysTheChoiceGoesOnlyWhenInstallJSONIsRemoved: fails, old copy text. Verification on this head: - Swift: swift build passed. swift test: 856 executed, 5 skipped (environment-gated), 0 failures. - Rust: the repo has no Cargo.toml at its root. The crate at poc/reverse-attach-linux: cargo test gave 604 passed, 0 failed, 17 ignored.
…ners=none The arm64 run failed a_tree_that_listens_is_reported_by_kind_and_a_silent_one_as_none with listeners=unknown. spawn returns right after exec while the loader may still open and close library fds, and a vanished fd is unknown by design. Poll gather for up to 5s; a tree that stays unknown still fails.
Refs #169
Change
Four follow-up items from the #165 review that are still valid on main:
PlaywrightBackendnow logsbrowser: chrome_check_failed class=<class>. Only the class is logged, never a path. Before, only the consent step logged this. The line is written on each failing status, tools or call, so a persistent Chrome problem repeats the line. Log volume is an owner decision and is not changed here.InstalledChromeChecker.check()walks/Applicationsand then~/Applicationsand returns the first copy that passes. If no copy passes, it returns the problem of the first existing copy, so the error class does not change. The protocol doc comment now says this.FakeInstallFixturenow defaults to a Chrome checker over no directories, so no test reads the real/Applications.install.jsonis removed, which matches R7.7.Review fixes on this head (review pass 1 on ff99d8c): the doc comment on
check()was stale (fixed); the candidate-order test now gives the two copies different failure classes and pins which class is reported (fixed); the wiring test uses/home/exampleas the home path (fixed).Tests
Failing before the change, passing after. "Before" ran the new tests against the base sources:
testChromeProblemDuringBrowserUseIsLoggedWithItsClass: fails before (no log line), passes after.testAValidCopyInHomeApplicationsIsUsedWhenTheSystemCopyFails: fails before (returnsinvalidSignaturefrom the/Applicationscopy), passes after. The same test also pins that a failing system copy's class is reported when both copies fail.testFixtureDefaultCheckerNeverReadsRealApplications: caveat. It only fails before the change on a host that has a Chrome-named bundle in/Applications. The Swift test host has no Chrome, so the before run placed a temporary stand-in unsigned bundle there, and removed it afterward. Before:invalidSignature. After:notFound. It is a regression guard for this fixture only, not a general guard.testRemoveCopySaysTheChoiceGoesOnlyWhenInstallJSONIsRemoved: fails before (old copy text), passes after.Verification for head 6c26ea4
swift buildpassed.swift test: 856 executed, 5 skipped (environment-gated, also skipped on main), 0 failures.Cargo.tomlat its root. The only crate ispoc/reverse-attach-linux, and this diff does not touch it.cargo testthere: 604 passed, 0 failed, 17 ignored.CI note
The first run on ff99d8c failed one test in the Rust crate (
probe::tests::a_tree_that_listens_is_reported_by_kind_and_a_silent_one_as_none) in the arm64 hands-node job. The same workflow passed on main, and the crate passed on a second host with this diff, so the failure looks environment-dependent. This diff changes no Rust file.Not in this PR