Skip to content

fix(e2e): preserve initial plan coverage across partial sync retries #2202

Description

@rspurgeon

Problem

The initial all sync can recover from a partially applied execution, then
fail because its assertions expect the original creation plan. Track this as
the first implementation task under #1943. Keep all in blocking CI.

In PR #2197, attempt 1 applied 42 changes, failed gateway-service resolution
with a connection reset, and skipped one dependent change. Attempt 2 succeeded
and created the remaining API implementation. Assertion assert-002 then
expected all-key-auth to appear as CREATE, although it already existed.
The terminal failure was an assertion mismatch, not an execution timeout.

Failed shard

Captured evidence: all/scenario.yaml, 002-sync-all/000-sync-all;
execution attempts 28.629s and 7.297s; terminal phase assertion;
execution retry stop succeeded. The retry plan contained only the API
implementation. Assertions/backoff added approximately 31 seconds.

Proposed change

  1. After reset, generate a read-only sync-mode plan and assert the expected
    CREATE actions, resource references, dependencies, and other initial-plan
    contracts against that immutable plan, before any mutation.
  2. Execute sync with bounded recovery. Assert successful execution, then
    verify expected remote resources and fields through readbacks, followed
    by the existing no-op convergence and deletion lifecycle checks.
  3. Audit the assertions attached to this retried sync. Move assertions that
    depend on the original remote state to the pre-execution plan check.
    Preserve their coverage; do not replace them with fixed/minimum retry-plan
    counts or a broad CREATE-or-UPDATE allowance. Already-created resources
    can be absent from the retry plan entirely.
  4. Avoid retry delays when rechecking the same immutable output. Preserve
    polling for assertion sources that actually perform fresh remote reads.
  5. Document this authoring pattern for stateful scenarios.

The initial plan is a coverage artifact, not a saved CREATE plan to blindly
reapply after partial success. Normal execution retries should replan from
current state. Full scenario reset/restart is reserved for tests whose actual
contract requires a clean initial state; do not make it the default recovery.

Acceptance criteria

  • A deterministic fault after some creates reproduces the old failure and
    passes after recovery with the new assertions.
  • Missing desired resources, wrong fields, incorrect initial plan actions,
    failed convergence, and failed deletion still fail the scenario.
  • Successful execution alone cannot satisfy the scenario's resource checks.
  • Immutable-output mismatches fail without repeated backoff; fresh readback
    assertions retain bounded eventual-consistency polling.
  • All attempt artifacts remain available and identify the final assertion
    source. Extend existing test seams rather than adding production fault
    injection solely for this scenario.
  • all remains blocking; no automatic assertion-failure shard reruns.

Related: #1695 covers surfacing assertion mismatches in Actions summaries.

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

    bugSomething isn't workinge2eIssue related to the e2e tests and testing frameworkhigh-priorityThis item should be addressed asaptriagedThis item has been triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions