Skip to content

flaky: lease-files and relay-gateway-files tests answer 422 instead of 201 on a clean base #1613

Done

Description

@V3RON

src/daemon/lease-files.test.ts (3 tests) and src/daemon/relay-gateway-files.e2e.test.ts (4 tests) fail with expected 422 to be 201 on merge-base 9333028 (failed 2 of 2 runs of lease-files.test.ts there), found auditing #1595. Likely environment dependent (local macOS).

Written by an agent.

Activity

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

    @V3RON
    ContributorAuthor

    Reproduction

    Confirmed. A defect in the two test rigs, not in the product: they upload through a worker on the real disk and keep the default 10 GiB disk-pressure threshold, so any host with less free disk gets 422 INSUFFICIENT_DISK_SPACE. This host has 20 GiB free (df -h $TMPDIR), so the tests pass here today. The reproduction fakes a 5 GiB host. Branch bug/1613-repro:

    • src/daemon/lease-files.test.ts: "the lease-files rig > stores an upload when the host has less free disk than the worker's default disk-pressure threshold"
    • src/daemon/relay-gateway-files.e2e.test.ts: "the file rig's worker stores an upload when the host has less free disk than the worker's default disk-pressure threshold"
    pnpm exec vitest run --project unit src/daemon/lease-files.test.ts src/daemon/relay-gateway-files.e2e.test.ts
    AssertionError: expected 422 to be 201   (lease-files.test.ts:83, relay-gateway-files.e2e.test.ts:239)
    

    Root cause

    src/daemon/lease-files.test.ts:36 (rig()) and src/daemon/test-relay-support.ts:392 (startFleet's worker configOverrides) start a worker with NodeFilesystem and leave diskPressure.freeBytesThreshold at its default, 10 GiB (src/core/config-defaults.ts:118). The failure shows at src/lease-files/store.ts:225, which refuses an upload while free disk is below the threshold. ADR 0067 §4 requires that refusal, so the product is right. The tests pass or fail depending on the host's free disk. src/http/app-leases-files.test.ts:32 already sets the threshold to 0.

    Simplest fix

    Add diskPressure: { freeBytesThreshold: 0 } to the configOverrides in rig() and in startFleet's worker. Tried it:

    pnpm exec vitest run --project unit src/daemon/lease-files.test.ts src/daemon/relay-gateway-files.e2e.test.ts <12 more files that use test-relay-support>
    Test Files  14 passed (14)   Tests  173 passed (173)
    

    Alternatives rejected

    • A fake diskFree in each rig: more code, and the same result.
    • Setting the threshold in test-main.ts's start(): it changes every daemon test, and only these rigs use the real disk.

    Risk

    • startFleet replaces the configOverrides that startWorker sets, so the key goes in startFleet, not startWorker.

    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 24, 2026
  5. added
    bug:ready
    and removed
    bug:new
    on Nov 24, 2026
  6. self-assigned this
    on Nov 24, 2026
  7. V3RON commented on Nov 24, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #1826 (#1613)
    Parked: none
    Waiting: none
    Decided: none

    Written by an agent.

  8. added a commit that references this issue on Nov 25, 2026
    5009b8e
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