Skip to content

ui-server: a hygiene keep-copy mixed-versions test exceeds its 30 s budget under load, and its CLI subprocess is killed #3878

Open

Description

@schlessera

Context

During a full local run of ./packages/ui-server/tests on a heavily loaded host (load average about 29 on 32 cores), one case failed:

  • packages/ui-server/tests/hygiene-media-effects.test.ts:735 "mixed versions: a keep-copy answer this server does not know as kept is never resolved, and the copy is compensated". It failed after 30816.95 ms, just past the suite's 30 s per-test timeout (bun run test supplies --timeout 30000).
  • The error was brain hygiene media delete media-2026-07-12-harbour-dawn-fffe --expect-fingerprint a1f239224b2f --dry-run exited null:, with empty stderr, thrown by the fixture's real helper (packages/ui-server/tests/hygiene-media-effects.test.ts:56-60). The fixture runs the real core CLI through Bun.spawnSync (packages/ui-server/tests/hygiene-media-effects.test.ts:39). The server calls it from cli (packages/ui-server/src/inbox/hygiene-review.ts:57-70), reached through mediaPlan and prepareOptions during select.
  • An exit code of null means the CLI subprocess was killed by a signal rather than exiting. It was killed as the test crossed its 30 s budget.

Rerun on its own on the same host, still under load (load average about 33), the file passed: 34/34, exit 0, 298 s in total. The case loops over two answers (kept-v2, outcome: kept), each with a fresh fixture and several real CLI spawns, so its runtime scales with host load.

Observed while working on an unrelated PR (#3827), which does not touch hygiene code. This is not part of #3813.

Scope

  • Make this case's time budget fit its real work under load. Options include splitting the two answers into separate cases, raising this case's timeout to a stated bound, or reusing one fixture where the property allows it.
  • Keep every assertion and the real CLI calls.

Out of scope

  • Other hygiene-media-effects cases, unless they share the same cause and the same fix.
  • Changing the suite-wide 30 s timeout or scripts/test.ts.
  • Replacing the real CLI with a stub.

Acceptance criteria

  • The case no longer depends on finishing two fixtures' worth of real CLI spawns inside one 30 s budget. Each answer either has its own budget or is a separate case, and the bound is stated in a comment.
  • Every existing assertion in the case is unchanged.
  • A failing-first receipt shows the old shape failing under a reproduced slow CLI (for example, a wrapped real that delays each spawn), and the new shape passing.

Verification

  • bun run test packages/ui-server/tests/hygiene-media-effects.test.ts, exit 0.
  • The slow-CLI reproduction from the acceptance criteria, recorded in the PR.

Contract impact

None.

Activity

  1. added this to the 0.45.0 milestone on Nov 10, 2026
  2. added
    type: test
    area: ui-server
    priority: p3
    agent-ready
    on Nov 10, 2026
  3. removed this from the 0.45.0 milestone on Nov 11, 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

    agent-readyarea: ui-serverpriority: p3type: test

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions