Skip to content

Reuse the test runner server across requests #35

Description

@piraz

Problem

testrunner.HttpTestRunner creates and closes a new httptest.Server for every request. This prevents multi-request flows from preserving server lifecycle state and makes the runner unsuitable for persistent HTTP sessions.

Scope

  • Reuse one httptest.Server for the lifetime of an HttpTestRunner.
  • Reuse one HTTP client so cookies and transport state persist across requests.
  • Preserve dynamic WithHandler and WithHandlerFunc behavior.
  • Close the server automatically when the owning test completes.

Acceptance criteria

  • Multiple requests through the same runner use the same server.
  • Session cookies survive between requests.
  • Existing simple route and handshake tests continue to pass.
  • The runner has regression coverage for persistent server/session behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions