Skip to content

iOS: a failed seed make drops the error of deleting its seed clone #1805

Open

Description

@V3RON

src/drivers/ios/seeds.ts:423 (#undoFailedMake):

if (seedClone !== undefined) await this.#deleteSeedSimulator(seedClone).catch(() => undefined);

#deleteSeedSimulator throws on a non-zero or timed-out simctl delete, and this .catch drops it unlogged. Unlike the throwaway next to it, a clone that could not be deleted does not keep the row, so it stays in the sources set as an orphan source with no line naming its UDID. Same shape as saveSource at seeds.ts:183.

Found while triaging #1804.

Written by an agent.

Activity

  1. added
    bug:newReported. An agent may triage it (rule 8); the fast track may set it ready (rule 17).
    on Nov 22, 2026
  2. self-assigned this
    on Nov 22, 2026
  3. V3RON commented on Nov 22, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    Confirmed. src/drivers/ios/index-seed-throwaway.test.ts, "a make that fails after its throwaway is gone, whose seed clone's delete then exits non-zero or times out, logs the clone's UDID" (branch bug/1805-repro). The make fails at markReady (a trigger refuses the row turning ready), after the throwaway is deleted, so no row is kept. Three cases: a delete that works (no warning), one that exits 1, one that times out.

    pnpm exec vitest run --project unit src/drivers/ios/index-seed-throwaway.test.ts -t "logs the clone's UDID"
    
    AssertionError: a delete that exits non-zero: expected [] to deeply equal [ Array(1) ]
    - "could not delete seed clone 00000000-0000-0000-0000-0000000000aa after a failed make: simctl delete 00000000-0000-0000-0000-0000000000aa exited with code 1: Unable to delete"
    + []
    

    Root cause

    Defect. src/drivers/ios/seeds.ts:423 runs this.#deleteSeedSimulator(seedClone).catch(() => undefined). #deleteIn (seeds.ts:489) throws on a non-zero exit or a time-out, and the .catch drops it. With the throwaway already gone, keepRow is false and seeds.ts:412 deletes the row, so the clone stays in the sources set with no row and no log line naming it. When the throwaway delete is what failed, the kept making row still names the clone and the sweep removes it; only this path leaves an orphan.

    Simplest fix

    Log the delete error, as #1804 proposes for saveSource:

    if (seedClone !== undefined) {
      await this.#deleteSeedSimulator(seedClone).catch((deleteError: unknown) => {
        this.#logger?.warn(
          `could not delete seed clone ${seedClone} after a failed make: ${errorMessage(deleteError)}`,
        );
      });
    }
    pnpm exec vitest run --project unit src/drivers/ios   # with the fix
    Test Files  34 passed (34)
         Tests  766 passed | 1 skipped (767)
    

    Alternatives rejected

    • Keep the making row while the clone is undeletable, so a later sweep deletes it: changes what doctor shows.
    • Retry the delete: a timed-out simctl delete may still be running.

    Risk

    Fast track

    • Defect: yes
    • Fix tried: yes
    • Nothing public added or broken: yes
    • No ADR or rule changed: no — the regression test asserts an undocumented log line (testing rule 8)
    • One fix: no — keeping the row for a sweep would change what doctor shows

    Written by an agent.

  4. removed their assignment
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug:newReported. An agent may triage it (rule 8); the fast track may set it ready (rule 17).

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions