Repository navigation
CRAP follow-ups: test-quality fixes from child PR reviews #3461
Copy link
Copy link
Closed
Description
Purpose
The maintainer's reviews of the merged CRAP burn-down child PRs (#3414) left take-or-leave test-quality suggestions. This issue keeps the ones that catch a real regression or remove flakiness, and drops the purely cosmetic ones (casts, PR-body counts, import style). Each retained item must name the regression it would catch.
Area 1: client and perf-capture tests (#3429, #3432) — #3463
- Ineffective assertion: the close-code test in
client-companion-tunnel-worker.test.tsonly pins the final wire code.normalizeOutgoingCloseCodere-maps 1011/1001/1005 to 3001, so changingnormalizeCloseCodedoesn't fail it. PinnormalizeCloseCode's own output through the public seam, or drop the redundant first stage. (test(client): cover the out-of-process CRAP functions through their public seams #3429) - Shared scenario state: the test in
client-metro-companion.test.tsthat chains seven scenarios lets case 7 reuse case 6's state file, so one failure hides the later ones. Usetest.each, or one test per case with its own state. (test(client): cover the out-of-process CRAP functions through their public seams #3429) - Wrong path in a comment: the EPERM comment in
client-metro-companion.test.tscitessrc/daemon/process/daemon-stop.ts; the file issrc/daemon/daemon-stop.ts. (test(client): cover the out-of-process CRAP functions through their public seams #3429) - Message-string assertion: the "rejects a non-xctrace kind" test in
platform-runtime-perf-capture-host.test.tsasserts a message string. Assert a typed error code ifwrongNativeKindhas one. (test(platform-runtime): cover Apple perf capture and runner transport branches #3432)
Area 2: Android, Linux and Apple tests (#3433, #3434, #3435) — #3462
- Wall-clock flakiness: the boot-timeout test in
emulator-lifecycle.test.tsruns 80 ms polls against a 150 ms deadline and asserts exactly 2 calls, so 20 ms of overshoot fails it. Use fake timers or a lower-bound assertion. (test(android,harmonyos,linux,provision-kit): cover boot-failure and toolchain probe branches #3433) - Assertion that can't fail: the
notEqual(BOOT_COMMAND_FAILED)right after theANDROID_BOOT_TIMEOUTequality can never fail. Remove it. Keep "keeps original details" only if the reason override is intentional. (test(android,harmonyos,linux,provision-kit): cover boot-failure and toolchain probe branches #3433) - Linux negative controls: the degenerate-rect snapshot test pins nothing observable. The missing-depth test would still pass with a default depth of 1. Add a depth-0 sibling with a smaller area after it. (test(android,harmonyos,linux,provision-kit): cover boot-failure and toolchain probe branches #3433)
- Host-binary fixture: the IPA fixture in
install-artifact.test.tsshells out to the hostzip. Use host-kit'swriteZipFixture. Also, the spent-deadline test inphysical-device-files.test.tsshould assertdetails.step. (test(platform-apple): cover core launch diagnostics, CoreDevice normalization, runner-file copy, and IPA hint resolution #3434) - Mock scope:
host-provider.test.tsreturns a cast partialfs.Stats, and itsscratchHome()tmp dir is unused. Use a real tmp directory for the user-Applications case and mock only the system roots. The "only needs to be a record" test inrunner-xctestrun-products.test.tsis weaker than its neighbors; make it pin an observable outcome. (test(platform-apple): cover macOS host app discovery and xctestrun product collectors #3435)
Dropped as cosmetic: inline import(...) types and the double cast in the perf-capture test, fallow-crap.json comment wording, createCompanionBridgeServer migration of older tests (separate refactor), and PR-body line counts.
Completion
- Tests only, through public entry points, with no production changes, no new exports and no test-only DI. Each PR ≤ 1,000 gross lines.
pnpm check:affected --runpasses on the pushed head.
Part of #3414.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
thymikee commentedon Oct 12, 2026
Both areas merged: #3463 (client and perf-capture tests) and #3462 (Android, Linux and Apple tests).