Skip to content

fix(tests): test_each_identity_keeps_its_own_quota_and_response_cache passes alone and in a serial run, not only under xdist #1411

Closed as not planned

Description

@dan-petty

Problem

tests/test_github_rate_limiter.py::test_each_identity_keeps_its_own_quota_and_response_cache fails when run alone or in a serial run (-n0) with KeyError: 'env' at call.kwargs["env"] (around line 1365), and passes under xdist. Seen at 3f1935a and on the #1364 branch on 2026-10-08. It looks order-dependent: some subprocess.run call that is cached or warmed up by an earlier test in the same worker reaches the test's assertion without an env keyword.

Acceptance criteria

  • Find the call that arrives without env and make the test assert only on the gh argv calls it means to check, so it passes alone, serially and under xdist.
  • uv run pytest tests/test_github_rate_limiter.py -n0 and -p randomly (or a shuffled order) both pass, each call phase stays under 1 s, and uv run devops ci passes.

Strategic alignment


Found on 2026-10-08 while delivering #1364. Filed directly with no priority; the roadmap service's intake sets Priority, Value and Effort.

Activity

  1. added
    type/bug
    scope/ci
    source/agent
    on Oct 8, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. A non-hermetic test undermines CI confidence and can mask real regressions, but it does not break production behaviour.
    • Value: Medium. Restoring test hermeticity protects the suite's ability to catch real failures in any execution order.
    • Effort: Low. The fix is to narrow the test's assertion to the specific gh argv calls it intends to check, removing sensitivity to unrelated cached subprocess.run calls.
  3. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Closing as a duplicate of #1418, which keeps it. #1418 found the cause: Tracer.__init__ calls platform.platform() (telemetry/tracer.py:742), which runs uname -p through subprocess on first use. When this test runs first in its process, its subprocess.run patch (tests/test_github_rate_limiter.py:1354) records that call, which has no env, so call.kwargs["env"] (:1365) raises. This item's serial and shuffled-order criterion moves to #1418.

    Found by the 2026-10-08 backlog review.

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

    scope/cisource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions