Skip to content

fix(#446): wrap E2E ImageRepository updates with RetryOnConflict - #448

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/446-retry-on-conflict-e2e
Open

fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/446-retry-on-conflict-e2e

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Description

Wrap all 6 read-modify-write E2E test helper calls on ImageRepository objects with retry.RetryOnConflict(retry.DefaultRetry, ...) to eliminate flaky 409 Conflict errors.

The helpers UpdatePushSecretName, AddAnnotationsToIR, and RemoveFinalizerFromIR (from CommonController) perform GET-then-UPDATE without conflict retry. When the image-controller reconcile loop modifies the same ImageRepository between the test's read and write, the test fails with the object has been modified. This was observed on 4+ unrelated PRs (#379, #419, #408, #353).

Changed call sites in e2e-tests/tests/image_controller_v2.go:

  • UpdatePushSecretName (1 site)
  • AddAnnotationsToIR (2 sites)
  • RemoveFinalizerFromIR (3 sites)

The k8s.io/client-go dependency (v0.34.2) was already present in e2e-tests/go.mod.

Testing

  • go build ./tests/ passed (e2e-tests project compiles successfully)
  • go vet ./tests/ passed (no issues found)
  • gofmt reports no formatting issues
  • E2E tests require a running Konflux cluster and cannot be run in the sandbox. Manual verification across 10+ PR runs is needed to confirm the flake is resolved.

Closes #446

Post-script verification

  • Branch is not main/master (agent/446-retry-on-conflict-e2e)
  • Secret scan passed (gitleaks — 2fb397e3564bbd49b34ee23d39d695c941c712ef..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

The E2E test helpers UpdatePushSecretName, AddAnnotationsToIR, and
RemoveFinalizerFromIR perform GET-then-UPDATE on ImageRepository
objects without conflict retry. When the controller reconciles the
same object concurrently, the test's write hits a stale
resourceVersion and fails with a 409 Conflict error. This flake was
observed across 4+ unrelated PRs.

Wrap all 6 read-modify-write call sites in
retry.RetryOnConflict(retry.DefaultRetry, ...) so transient
conflict errors are retried automatically using the standard
client-go backoff.

Note: golangci-lint could not run (sandbox restriction). go build,
go vet, and gofmt passed. E2E tests require a cluster and cannot
be run by the code agent.

Closes #446

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner November 12, 2026 12:52
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Nov 12, 2026
@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code Review by Qodo


Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Qodo Logo

@konflux-ci-qe-bot

Copy link
Copy Markdown

Scenario: konflux-e2e-image-controller
@fullsend-ai-coder[bot]: The following test has Failed, say /retest to rerun failed tests.

PipelineRun Name Status Rerun command Build Log Test Log
konflux-e2e-image-controller-6z67x Failed /retest View Pipeline Log View Test Logs

Inspecting Test Artifacts

To inspect your test artifacts, follow these steps:

  1. Install ORAS (see the ORAS installation guide).
  2. Download artifacts with the following commands:
mkdir -p oras-artifacts
cd oras-artifacts
oras pull quay.io/konflux-test-storage/konflux-team/image-controller:konflux-e2e-image-controller-6z67x

Test results analysis

🚨 Error occurred while running the E2E tests, list of failed Spec(s):

➡️ [failed] [It] [image-controller-suite Image Controller E2E tests] image repository and component connection check component version onboarding status [image-controller, smoke]

Click to view logs

failed while checking component "test-comp-ktfh" version status to succeeded
Unexpected error:
    : 
    context deadline exceeded
    {}
occurred

➡️ [failed] [It] [image-controller-suite Image Controller E2E tests] creates an image repository with visibility private image repository is created successfully [image-controller, private]

Click to view logs

failed while waiting for image repository "image-repository-ibsr" to be ready
Unexpected error:
    : 
    context deadline exceeded
    {}
occurred

➡️ [failed] [It] [image-controller-suite Image Controller E2E tests] credential rotations image repository is created successfully [image-controller, credential-rotation]

Click to view logs

failed while waiting for image repository "image-repository-tjao" to be ready
Unexpected error:
    : 
    context deadline exceeded
    {}
occurred

➡️ [failed] [It] [image-controller-suite Image Controller E2E tests] namespace wide pull secrets second image repository is created successfully [image-controller, namespace-pull]

Click to view logs

failed while waiting for image repository "image-repository-two-wfit" to be ready
Unexpected error:
    : 
    context deadline exceeded
    {}
occurred

➡️ [failed] [It] Image Controller E2E tests using generate annotation when a new component is created with visibility private triggers a PipelineRun [image-controller, private]

Click to view logs

Failed to create private image repo in redhat-appstudio-qe org

OCI Artifact Browser URL

View in Artifact Browser

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

Labels

ready-for-review Triggers review agent dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add retry-on-conflict to E2E test helpers that update ImageRepository objects

1 participant