Skip to content

src/agent-device/edge-release.test.ts fails 6 tests at base 4f6bb7dd (gateway pool never ready) #1863

Done

Description

@V3RON

Run pnpm exec vitest run --project unit src/agent-device/edge-release.test.ts on 4f6bb7d (detached worktree) and on task/1845: 6 of 14 fail with AssertionError: expected [] to deeply equal [ 'ready' ] (Matcher did not succeed in time). Same family also seen in src/agent-device/edge-lease-end.test.ts and a gateway sweep/adoption test in pnpm test:changed (13 failures). Found while auditing #1845; the diff touches none of them.

Written by an agent.

Activity

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

    @V3RON
    ContributorAuthor

    Reproduction

    The failure depends on the host, not the code: edge-release.test.ts passes 14/14 at 4f6bb7dd and at main on a quiet host (74 % memory free), including six copies run at once. The agent-device rigs read the host's real memory. Simulating a host at warn pressure in the rig gives the reported failure exactly:

    $ pnpm exec vitest run --project unit src/agent-device/edge-release.test.ts   # rig given a probe reading pressure "warn"
    AssertionError: expected [] to deeply equal [ 'ready' ]     (x6)
    Tests  6 failed | 8 passed (14)
    

    On bug/1863-repro, one test per rig (one file cannot import both: Fallow reports a duplicate export):

    $ pnpm exec vitest run --project unit src/agent-device/worker-rig-host-load.test.ts src/agent-device/gateway-rig-host-load.test.ts
    worker rig  > starts its daemon without building the host's real load probe
      AssertionError: expected "vi.fn()" to be called +0 times, but got 1 times
    gateway rig > starts its gateway and worker daemons without building the host's real load probe
      AssertionError: expected "vi.fn()" to be called +0 times, but got 2 times
    

    Root cause

    src/agent-device/test-support.ts:164 and src/agent-device/test-gateway.ts:201,255 call startDaemon without hostLoadProbe, so src/daemon/worker-composition.ts:244-247 builds productionHostLoadProbe and the worker samples this machine's kern.memorystatus_level and kern.memorystatus_vm_pressure_level. When the host is at warn or has under 20 % available (busy agents, booted simulators), MemoryPressureTracker sets warming-paused (ADR 0068) and the warm pool starts nothing. liveStates then stays []. That is the symptom in edge-release, edge-lease-end and the gateway-rig tests. The other two daemon rigs pass hostLoadProbe: null (src/daemon/test-main.ts:51).

    Simplest fix

    Add hostLoadProbe: null to the three startDaemon calls (3 lines).

    reproduction: 2 passed
    pnpm exec vitest run --project unit src/agent-device/   ->  45 files, 538 passed | 1 skipped
    

    Alternatives rejected

    Risk

    • Check that no agent-device test reads load or memoryPressure from a rig (grep finds none).
    • The two reproduction files mock the ports barrel. A fix that builds the probe some other way would pass the test but still read the host.

    Fast track

    • Defect: yes
    • Fix tried: yes
    • Nothing public added or broken: yes
    • No ADR or rule changed: yes
    • One fix: yes

    Side findings

    Written by an agent.

  4. removed their assignment
    on Nov 25, 2026
  5. added
    bug:ready
    and removed
    bug:new
    on Nov 25, 2026
  6. self-assigned this
    on Nov 25, 2026
  7. V3RON commented on Nov 25, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #1868 (#1863)
    Parked: none
    Waiting: none
    Decided: none

    Written by an agent.

  8. added a commit that references this issue on Nov 26, 2026
    9021bd9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug:readyflaky-test

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions