Skip to content

Flaky: http.test.ts 'rejects near the configured timeout' under load #324

Description

@LinuxDevil

Goal

src/tools/built-in/http.test.ts "rejects near the configured timeout" fails intermittently under load in the full suite (npm run test:coverage), then passes alone and on re-run. Seen by three round-2 agents on 2026-10-02/03 (N1a #318, A4 #322 failed it in two of four coverage runs). A flaky test hides real failures; make it deterministic.

Scope

  • Make the test independent of wall-clock load: fake timers, or a mocked fetch that resolves on an injected clock, instead of a real delay compared to a real timeout.
  • Keep what it proves: the request is aborted near the configured timeout and the error is the documented one.
  • Check src/security/credentialBroker.test.ts and guardrails.test.ts timeout tests (listed as flaky in the brief) for the same pattern; fix them in the same PR only if the fix is the same.

Acceptance criteria

  • The test passes 20 times in a row inside the full suite run in parallel (npx vitest run src/tools src/security src/guardrails repeated, or --repeat), on Windows.
  • No production code change unless the test proves a real bug (then say so).

Labels: round-2 follow-up, model sonnet.

🤖 Generated with Claude Code

Activity

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

    model:sonnetWell specified; a Sonnet agent can take itround-2Round 2 plan ticket

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions