Skip to content

Flaky console lane: CLI auto-launch's fixed 5 s deadline expires while a daemon starts on a loaded runner (ENOENT daemon.sock) #663

Closed

Description

@V3RON

What happens

Console lane, once in 198 recent Console job runs (run 38955614485, main at 93ffed8f, webkit):

Error: {"error":{"code":"INTERNAL","message":"Timed out starting simlock daemon: connect ENOENT /tmp/simlock-console-GGA6zr/daemon.sock"}}
    expect(received).toBe(expected)
    Expected: 0
    Received: 1
    > 110 |     expect(started.code, started.stderr).toBe(0);
        at start (e2e/console/fixtures.ts:110:42)

A rerun of the same job passed.

What is known

Found while triaging #642.

Written by an agent.

Activity

  1. added
    bug:new
    flaky-test
    and removed
    bug:new
    on Oct 17, 2026
  2. self-assigned this
    on Oct 17, 2026
  3. V3RON commented on Oct 17, 2026

    @V3RON
    ContributorAuthor

    Confirmed, reproduced deterministically.

    Reproduction

    src/cli/index.test.ts — "reports as running a daemon still booting past the deadline…", on bug/663-repro (50cf713e):

    pnpm exec vitest run --project unit src/cli/index.test.ts -t "startup deadline"
    -  { exitCode: 0, label: "5.1 s", stderr: "", stdout: '{"status":"running"}\n' }
    +  { exitCode: 1, label: "5.1 s", stdout: "",
    +    stderr: '{"error":{"code":"INTERNAL","message":"Timed out starting simlock daemon:'
    +            ' No IPC endpoint at /simlock/daemon.sock"}}' }
    

    The daemon claims its socket 5.1 s after launch, on the poll's own clock; the 4.9 s case passes, so the deadline is straddled. No loaded runner needed.

    Root cause

    Defect, in user-facing code. AutoLaunchIpcConnector polls every 50 ms for a hardcoded 5 s (src/cli/index.ts:235), then throws a plain Error (:246) the CLI renders as INTERNAL, exit 1. The daemon it launched is detached and unref'd (src/ports/daemon-launcher.ts:33-45) and serves a second later: a start that succeeded reports as one that failed. No user doc names 5 s and no key sets it; the MCP's copy of the loop takes startupTimeoutMs yet defaults to the same 5 s (src/mcp/connect.ts:51). The console lane starts a daemon per test, with no retry unlike e2e/helpers/http-daemon.ts (#553). Census, 492 Console job runs over the last 500 CI runs: 16 failures, this signature in 1 (run 38955614485, 93ffed8f); #642's route.fetch family in 7.

    Simplest fix

    One startup deadline shared by both loops, long enough for a loaded machine — 20 s — the CLI's connector taking the option MCP's loop has. The repro pins the shape: exit 0, {"status":"running"}.

    Alternatives rejected

    • Retrying in the console fixture, as withHttpDaemon does — hides the flake, leaves this repro red.
    • A daemon.startupTimeoutMs key — nobody asked; a longer default covers this boot.
    • Softening the timeout's message — the message is honest; the bound is the defect.

    Risk

    Side findings

    Written by an agent.

  4. removed their assignment
    on Oct 17, 2026
  5. added
    bug:ready
    and removed on Oct 17, 2026
  6. self-assigned this
    on Oct 17, 2026
  7. V3RON commented on Oct 18, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #674 (#663), squash 24ce3d5a.

    Round 1 review only — spec, code (lens: both), claims: 0 blocking, 0 fixes, 1 claims note rejected. No slow lane needed. Gate passed on the head the reviews covered (cee82779); main had moved to bd664e22 but touches none of this PR's nine files, so no rebase and no new snapshot.

    Written by an agent.

  8. removed their assignment
    on Oct 18, 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:readyflaky-test

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions