Skip to content

task(e2e): capture HTTP connection phases for interrupted requests #2204

Description

@rspurgeon

Problem

PR #2172 successfully distinguished recovered execution errors from terminal
assertion failures and subprocess deadlines. Its records and existing logs
still cannot locate the network phase of a request interrupted by process
termination. This is a lower-priority follow-up under #1943, complementary to
#1695's assertion summaries.

  • PR 2195:
    deck/multi-file ends with khttp-000008, GET /v2/control-planes,
    at 2026-09-16 04:21:46.687 UTC; killed about 59 seconds later.
  • PR 2201:
    ai-gateway/vault ends with khttp-000001, GET /v1/ai-gateways,
    at 2026-09-16 15:13:54.727 UTC; killed about 60 seconds later.
  • PR 2197:
    all captures a connection reset on a gateway-services GET. The second
    execution succeeds; the eventual assertion failure is a separate event.

The #2201 stall is the first request of a new kongctl process. Reuse of an
earlier connection within that process cannot explain every observed stall.
Packet capture was disabled in all three inspected runs.

Proposed change

  • Add opt-in HTTP connection-phase events/timings, using existing logging
    conventions and Go HTTP tracing: DNS, connect, TLS, connection acquisition
    and reuse, request write, and first response byte.
  • Persist phase starts/progress as they happen so SIGKILL does not discard
    all evidence of an unfinished request. A final completion-only record is
    insufficient for this use case.
  • Correlate request records with the scenario, logical command, execution
    attempt, and artifact-relative paths. Request IDs can restart in each CLI
    process; do not treat them as globally unique.
  • Surface effective HTTP and subprocess budgets plus the last unfinished
    request/phase in diagnostics where supported. Keep evidence from recovered
    attempts distinct from the terminal failure.
  • Document a targeted diagnostic-run procedure, including the existing
    packet-capture option, and how to compare a failure against a successful
    command without automatically rerunning shards.

Acceptance criteria

  • Controlled delayed-response and connection-error cases identify the last
    observed phase and elapsed time, including when the process is terminated.
  • Missing events remain unknown; neither a subprocess deadline nor an open
    request is labeled a confirmed server timeout.
  • Events contain no credentials, request/response bodies, or sensitive query
    values; endpoint representation follows existing redaction conventions.
  • Existing normal-verbosity behavior remains bounded and tracing is opt-in.
  • Attempt links distinguish the first failed execution from final success
    and any later assertion mismatch.
  • This work does not change retry eligibility or duplicate Surface E2E assertion mismatch details in GitHub Actions summaries #1695's assertion
    diff rendering work.

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

    e2eIssue related to the e2e tests and testing frameworkenhancementNew feature or requestmedium-priorityThis item should be addressed in the medium term time frametriagedThis item has been triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions