Skip to content

test(android,linux,apple): flake, dead-assertion, and fixture fixes from CRAP reviews - #3462

Merged
thymikee merged 2 commits into
mainfrom
crap/3461-platform-test-quality
Oct 12, 2026
Merged

thymikee merged 2 commits into
mainfrom
crap/3461-platform-test-quality

Conversation

@thymikee

@thymikee thymikee commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Area 2 of #3461 (follow-ups to the #3433/#3434/#3435 reviews). Tests only; the one non-test change is a test-only export subpath (./archive-fixtures, audio-probe-fixtures precedent + R11 entry) reaching host-kit's zip fixture writer.

  • Boot-timeout flake (emulator-lifecycle.test.ts): the 80 ms/150 ms/exactly-2-calls geometry raced host scheduling; now on vi.useFakeTimers(). Mutation: dropping the BOOT_COMMAND_FAILED→ANDROID_BOOT_TIMEOUT normalization fails it.
  • Dead assertion: removed notEqual(BOOT_COMMAND_FAILED), subsumed by the reason equality. Kept "keeps original details" — deleting the details spread in buildAndroidBootFailureDetails fails it, so the override is load-bearing.
  • Linux negative controls (snapshot.test.ts): the degenerate-rect tie gained an out-of-bounds probe (widening the inclusive bound fails it); the missing-depth test pins the default in both sort directions (mutations depth ?? -1 / ?? 1 each fail one fixture).
  • Host-binary fixture (install-artifact.test.ts): the IPA is written with writeZipFixture; no host zip shell-out. The fixture moved to src/archive.fixtures.ts, and its encrypted-entry helper writes the flag through the same writer.
  • Spent deadline (physical-device-files.test.ts): asserts typed details.step/timeoutMs.
  • Mock scope (host-provider.test.ts): no cast partial fs.Stats; the mocked stat answers with real fs.Stats of backing tmp paths, the user Applications root is a real tmp dir, absent roots are declared.
  • xctestrun record target: the surviving record target names a bundle nothing else references; dropping record-target collection or the isRecord filter fails it alone.

Part of #3461, part of #3414

Validation

  • Tested/pushed SHA: fe44548d8.
  • pnpm check:affected --run: passed under the machine lock.
  • Each mutation observed failing, then reverted. check:layering, check:fallow, typecheck, lint, format:check pass.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.17 MB 5.17 MB 0 B
Package (unpacked) 5.17 MB 5.17 MB 0 B
Package (download) 1.55 MB 1.55 MB +1 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.4 ms 27.6 ms +0.2 ms
CLI --help 76.6 ms 80.0 ms +3.4 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/platform-linux/src/__tests__/snapshot.test.ts Outdated
Comment thread packages/host-kit/package.json
…nary fixtures from CRAP follow-up tests

- emulator-lifecycle: run the boot-timeout test on fake timers so the
  80ms poll / 150ms deadline geometry cannot drift with host scheduling,
  and drop the notEqual(BOOT_COMMAND_FAILED) assertion that the reason
  equality already subsumes.
- linux snapshot: give the degenerate-rect tie a negative control one
  pixel out, and pin the missing-depth default in both sort directions
  so only exactly 0 keeps the observed winner in both fixtures.
- physical-device-files: pin details.step on the spent-deadline failure.
- install-artifact: build the multi-payload IPA through host-kit's
  writeZipFixture instead of shelling out to the host zip binary.
- host-provider: answer the mocked hostFileStat with real fs.Stats of
  backing tmp paths, make the user Applications root a real directory,
  and declare missing roots explicitly instead of an implicit ENOENT.
- runner-xctestrun-products: seed a bundle only the surviving record
  target names so a target only needing to be a record is observable.
Move the archive fixture module from src/internal/ to src/archive.fixtures.ts
and export it as ./archive-fixtures (audio-probe-fixtures precedent) so
platform-apple's IPA fixture can write real stored-zip archives through
host-kit's writeZipFixture instead of the host zip binary. Replace the
host-zip encrypted-entry helper with a fixture-written encrypted flag, and
record the subpath in the R11 export-surface list.
@thymikee
thymikee force-pushed the crap/3461-platform-test-quality branch from f11e692 to fe44548 Compare October 12, 2026 03:38

@thymikee thymikee left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — both findings fixed in fe44548: the depth test now pins the default from both sort directions (depth ?? -1 and depth ?? 1 each fail one fixture), and the fixture module moved to src/archive.fixtures.ts with its encrypted-entry helper writing the flag through writeZipFixture — no host zip left in the exposed module.

@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready at fe44548. The changes are test files, a fixture move, and one package.json export, and the layering test enumerates the new export. All 19 checks pass, and I know of no conflicts. I read the code and traced the changes by hand. I did not run the tests or the claimed mutations. I also did not check the encrypted-fixture shape beyond the extractor's own entry checks. Not blocking, take or leave: expectBootFailure in https://github.com/callstack/agent-device/blob/fe44548/packages/platform-android/src/__tests__/emulator-lifecycle.test.ts#L140 is now a one-line wrapper over startedBootFailure, so one job has two helpers, and the other callers could use startedBootFailure or the two could merge; and issue #3461 says "no new exports" while https://github.com/callstack/agent-device/blob/fe44548/packages/host-kit/package.json#L23 adds the ./archive-fixtures subpath, so a line in the issue or close-out would explain why writeZipFixture had to move.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 12, 2026
@thymikee
thymikee merged commit 3417a77 into main Oct 12, 2026
19 checks passed
@thymikee
thymikee deleted the crap/3461-platform-test-quality branch October 12, 2026 06:38
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-12 06:39 UTC

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

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant