Skip to content

iOS tests check command limits on a spawn timeoutMs that nothing reads, which keeps it in spawn's options type #1984

Done

Description

@V3RON

iOS tests pin command limits through the timeoutMs option runCommand passes to spawn (src/drivers/ios/command-run.ts:26), which the Node runner never reads, so they cannot see whether the limit holds. Removing that dead option fails 41 tests in 9 files under src/drivers/ios (boot-deadline, index, index-device-set, index-provenance-root, index-save-source-lifecycle, index-seed-provision, index-slim-mode, physical, physical-presence). The real limit is the clock timer at command-run.ts:43; a test that advances the clock proves it.

While those tests read it, timeoutMs cannot leave spawn's options type (src/ports/process-runner-types.ts:2), so the compiler cannot refuse a call like #1979's.

Found while triaging #1980.

Written by an agent.

Activity

  1. added
    bug:new
    on Nov 30, 2026
  2. self-assigned this
    on Nov 30, 2026
  3. V3RON commented on Nov 30, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    Seen on: fakes (scripted runner, fake clock) and tsc.

    On bug/1984-repro:

    • "a hung … is ended by the clock at … ms and not 1 ms before, and is spawned with no limit of its own": 12 cases in src/drivers/ios/command-limits.test.ts and physical-files-and-limits.test.ts. Only the last clause fails.
    • src/ports/process-runner-types.test.ts: "a spawn given timeoutMs does not compile, nor does a run without it; a run with it and a spawn without it do".
    $ pnpm exec vitest run --project unit <the three files>
    AssertionError: expected { timeoutMs: 30000 } to deeply equal {}        (12 cases)
    AssertionError: expected [ 'line 4: TS2741' ] to deeply equal [ 'line 3: TS2353', 'line 4: TS2741' ]
    Tests  13 failed | 7 passed
    

    Root cause

    Defect, in types and tests; the limits themselves hold. spawn takes the options type of run (src/ports/process-runner-types.ts:162), against its own comment, so command-run.ts:26 compiles and tests read what nothing uses. The issue's 41 tests in 9 files are confirmed, but 13 of them also advance the clock:

    command-run.ts:43 mutated, src/drivers/ios run each time:
    timer never fires:                     28 of the 41 still pass
    both simctl lists, delete x1000, x0.5:  no test fails
    listapps, print-disabled, devicectl list/apps/uninstall x0.5: no test fails
    

    Simplest fix

    After #1979 and #1980:

    • type spawn's options Omit<ProcessRunOptions, "timeoutMs">;
    • drop the argument in runCommand;
    • in the nine files, drop the option or expect {}; delete index-seed-provision.test.ts's "boots the seed within" (two cases here replace it).

    The compiler then refuses exactly two calls: command-run.ts:26 and process-supervisor.ts:102 (#1979).

    fix tried on origin/main, then restored (the supervisor's option dropped, only to compile)
    src/drivers + src/ports: 2022 passed | 60 skipped; test:changed: 7567 passed | 61 skipped; typecheck clean
    with the fix, timer +1 ms or -1 ms: all 12 clock cases fail
    

    Alternatives rejected

    • spawn honours timeoutMs: contradicts the ports manual.
    • Remove it from ProcessRunOptions: ten more errors, in Android tests.
    • Drop the assertions only: those limits stay unproven.

    Risk

    Fast track

    Written by an agent.

  4. removed their assignment
    on Nov 30, 2026
  5. added
    bug:ready
    and removed
    bug:new
    on Dec 1, 2026
  6. self-assigned this
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions