Skip to content

swift test --parallel hangs after RootViewModel suite (pre-existing) #82

Closed

Description

@wei18

Observed 2026-05-21 during v2.3 Part A verification: mise exec -- swift test --parallel hangs after passing through ~919 log lines, with the test process stuck at low/zero CPU. The hang occurs in pre-existing v1 test code (post selectSettingsAppendsSettingsRoute), not in any v2 additions — focused filter runs (--filter RouteFactory|MonetizationStateStore|Composition|Privacy) complete in seconds.

Repro

  1. cd Packages/SudokuKit && mise exec -- swift test --parallel 2>&1 | tee /tmp/swifttest.log
  2. Watch the log — progresses through DailyHub/Board snapshot suites, then stalls at ~919 lines
  3. After that, no new lines for >5 minutes; swift-test process CPU stays at ~4s total

Suspected cause

A snapshot test or RootViewModel-level test acquires a resource (snapshot file lock? Task that never resolves?) and deadlocks. Needs bisection by suite.

Bisection plan

  1. Disable --parallel and retry
  2. If still hangs, run suites individually via --filter and identify the offender
  3. Inspect the hanging test for missing await, infinite Task, or filesystem-lock contention

Out of scope

  • Not blocking v2 ship (focused tests work)
  • Not blocking individual PRs (per-suite filter sufficient for verification)

Activity

  1. added
    architecture
    on May 21, 2026
  2. wei18 commented on May 22, 2026

    @wei18
    OwnerAuthor

    Partial bisection — 2026-05-22

    Triage subagent narrowed hang to one of 7 non-UI targets:
    ASCRegisterTests | GameCenterClientTests | GameStateTests | PersistenceTests | PuzzleStoreTests | SudokuEngineTests | TelemetryTests

    Symptom: pre-banner hang + 0% CPU = deadlock during test discovery / static initializer, NOT in a @Test body.

    Leader's follow-up bisection (perl alarm 60s per filter) — all 6 alternatives (ASCRegister, GameCenterClient, GameState, PuzzleStore, SudokuEngine, Telemetry) timed out at 60s when run sequentially. They appear to share contention on SwiftPM build dir / static init time, so individual filter runs aren't faster than the merged hang.

    Full triage report: meetings/2026-05-22_swift-test-hang-triage.impl-notes.md

    Most-suspect targets per subagent analysis:

    1. PersistenceTests — CK gateway / GameSession actor surface
    2. GameCenterClientTests — LiveGameCenterClient observer Task

    Next step (manual, not auto-bisectable in CI sandbox):

    • Open Xcode → click each suite individually → identify which test never finishes discovery
    • OR add --very-verbose to swift test invocation and capture pre-test trace

    Not blocking ship — focused tests + Part A+B+C green; full-suite parallel-mode is the only path that hangs.

  3. wei18 commented on May 23, 2026

    @wei18
    OwnerAuthor

    Bisection complete (2026-05-23). Root cause: swiftpm-testing-helper toolchain bug in --parallel pre-discovery bootstrap, not a project bug. Helper parked in S state with no test-banner emitted; deadlock in dispatch/worker-spawn path. Toolchain: Swift 6.3.2 / swift-testing 1902 / arm64-macos26.

    Workaround: drop --parallel from the canonical test command. Warm-cache serial run completes the full SudokuKit suite in under 10s.

    Full report at meetings/2026-05-23_swift-test-hang-bisection.impl-notes.md (landed via PR #110). Closing.

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

    architecture

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions