Skip to content

flaky: gateway-smoke #253 test gets 409 on the second lease request after a release #898

Closed

Description

@V3RON

e2e/gateway-smoke.test.ts › "returns workerId and worker on a gateway-granted lease, in POST /v1/lease-requests' 201 and in GET /v1/lease-requests/{id} (#253)" fails with expected 409 to be 201 at the second submit(), after the first lease was released and /v1/status showed 0 leases and a ready device. main is green; it is a race, worse on a loaded runner.

Failed runs:

Diagnosis: the 409 is REQUESTER_ALREADY_LEASED (src/gateway/fleet-coordinator.ts, #refuseIfAlreadyLeased). release() forgets the lease in the gateway's lease index. A worker view refresh that started before the release and lands after it still lists the lease, and FleetLeaseIndex#addReported (src/gateway/lease-index.ts) adds it back. The next fresh view only marks it missing; it is forgotten one view later. Until then the requester is refused.

Fix: a lease the worker confirmed released through the gateway is not re-added by a later snapshot.

Written by an agent.

Activity

  1. added
    bug:newReported. Nobody has looked yet.
    flaky-testNames a test that fails without a code change. Delivery skips its base-commit check.
    on Oct 23, 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:newReported. Nobody has looked yet.flaky-testNames a test that fails without a code change. Delivery skips its base-commit check.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions