Skip to content

Improve E2E timeout and retry behavior for stateful scenarios #1943

Description

@rspurgeon

Problem

The E2E scenario shard containing test/e2e/scenarios/all is sometimes perceived as timing out because all performs a large declarative lifecycle against one Konnect organization. Recent CI evidence suggests that disabling the scenario or adding artificial delays would address the symptom poorly:

  • PR task(sdk): update sdk-konnect-go to v0.62 patch #1942 ran all successfully twice at about 21.7 seconds.
  • Other recent failed shard runs completed all in roughly 33-35 seconds, then timed out in later scenarios.
  • A historical all failure took about 74 seconds but was not a timeout. The first stateful sync partially applied changes, the harness retried the whole command, and CREATE-action assertions no longer matched the converged plan.
  • all already sets maxConcurrency: 1, so declarative mutations are serialized.

The harness currently gives each CLI subprocess a blanket 60-second timeout. CI also sets KONGCTL_E2E_HTTP_TIMEOUT=0s. For CLI subprocesses this causes the harness to omit http-timeout from the profile, leaving kongctl's default 60-second HTTP timeout; direct harness HTTP operations have separate semantics. A near-full subprocess timeout is intentionally not retried. This can make a single stuck request consume the entire command deadline and provides limited information about the underlying cause.

Proposed improvements

  • Keep scenarios/all enabled because it exercises cross-resource planning, references, execution, no-op convergence, and deletion.
  • Preserve initial CREATE-action coverage in a read-only plan check before mutation; use stable convergence, summary, and readback assertions after execution retries.
  • Separate the effective HTTP request deadline from the 60-second subprocess timeout and budget for bounded read recovery.
  • Prefer bounded per-request HTTP deadlines and appropriate transport retries over artificial sleeps.
  • Support targeted longer command timeouts for unusually large sync/delete operations when CI evidence demonstrates they need additional time.
  • Improve failure reporting so the scenario, command, timeout layer, retry classification, and elapsed duration are immediately visible.
  • Measure failure frequency after these changes before considering scheduled/advisory execution.

Acceptance criteria

  • A partially successful stateful command can be retried without causing all to fail solely because its plan actions changed from CREATE.
  • E2E HTTP and subprocess timeout behavior is documented and internally consistent.
  • Timeout diagnostics identify whether the failure came from an HTTP request, CLI subprocess deadline, Go test deadline, or Actions job deadline.
  • No unconditional sleeps are added.
  • scenarios/all remains part of blocking CI unless measured post-change instability justifies quarantine.

Evidence

Implementation breakdown — September 16, 2026

PR #2172's capture now confirms both failure mechanisms across three PRs.
Implement the following independently reviewable tasks:

Keep #1695 as the existing task for displaying assertion mismatch details.

New evidence

Comparisons: the multi-file plan passed in 1.214s on #2197 and 1.481s on
#2201; vault retrieval by ID passed in 315ms on #2195 and 311ms on #2197.
The precise network/service cause of the two stalls remains unconfirmed.

Corrections to earlier implementation suggestions

  • CLI HTTP timeouts were not disabled by the CI 0s setting: profile
    omission retained the CLI's 60-second default. Direct harness HTTP helpers
    must be considered separately.
  • Each subprocess receives its own deadline. Earlier scenarios do not consume
    a later command's 60-second allowance; overall test/job budgets are separate.
  • Fixed/minimum retry-plan counts are also invalid after partial application.
    Already-created resources can disappear from the plan, not just become UPDATE.
  • Preserve CREATE coverage before mutation. Do not merely loosen assertions
    or blindly reapply a saved CREATE plan after partial success.

Immediate PR handling

A bounded manual rerun of the failed shards on #2195, #2197, and #2201 is
reasonable given the captured failures and successful comparisons. Require
normal E2E coverage/status verification to pass before merging. If a rerun
fails, retain and compare its new evidence instead of repeating until green.
These follow-up issues do not waive checks or authorize automatic retries.

Activity

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

Metadata

Metadata

Assignees

Labels

code improvemente2eIssue related to the e2e tests and testing frameworktriagedThis item has been triaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions