Skip to content

fix: wait for rolebinding in 1-084 to avoid intermittent fail#1201

Merged
openshift-merge-bot[bot] merged 1 commit into
redhat-developer:masterfrom
jgwest:fix-intermittent-fail-in-1-084
Jul 3, 2026
Merged

fix: wait for rolebinding in 1-084 to avoid intermittent fail#1201
openshift-merge-bot[bot] merged 1 commit into
redhat-developer:masterfrom
jgwest:fix-intermittent-fail-in-1-084

Conversation

@jgwest

@jgwest jgwest commented Jul 1, 2026

Copy link
Copy Markdown
Member

What type of PR is this?
/kind failing-test

What does this PR do / why we need it:

  • Fix intermittent failure by waiting for rolebinding in 1-084 to exist (which is created via managed-by label) before letting the test continue

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Test acceptance criteria:

  • Unit Test
  • E2E Test
�[38;5;243m------------------------------�[0m
�[0mGitOps Operator Sequential E2E Tests �[38;5;243m1-084_validate_prune_templates �[0m�[1mvalidates that resources with duplicate GVKs can be pruned successfully with local sync�[0m
�[38;5;243m/go/src/github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/sequential/1-084_validate_prune_templates.go:57�[0m
  Object exists in ExistByName: openshift-gitops
  HaveArgocdPhase: expected: Available / actual: Available
    Components:  Redis: Running Repo: Running Server:  Running ApplicationController: Running ApplicationSetController: Running NotificationsController:  SSO: Running
  �[1mSTEP:�[0m creating namespace 'gitops-e2e-test-0421a642-e6ce' �[38;5;243m@ 07/01/26 19:13:05.469�[0m
  �[1mSTEP:�[0m creating a temp dir for git repo �[38;5;243m@ 07/01/26 19:13:05.837�[0m
  �[1mSTEP:�[0m writing two OpenShift Templates (duplicate GVKs) to the working dir �[38;5;243m@ 07/01/26 19:13:05.837�[0m
  �[1mSTEP:�[0m logging into the Argo CD CLI �[38;5;243m@ 07/01/26 19:13:05.837�[0m
  executing command: argocd login (...)
  {"level":"warning","msg":"Failed to invoke grpc call. Use flag --grpc-web in grpc calls. To avoid this warning message, use flag --grpc-web.","time":"2026-07-01T19:13:06Z"}
  'admin:login' logged in successfully
  Context 'openshift-gitops-server-openshift-gitops.apps.ci-op-hi6vh47s-3fe53.ocp-gitops-qe.com' updated

  �[1mSTEP:�[0m Creating ArgoCD Application CR using the typed schema �[38;5;243m@ 07/01/26 19:13:07.746�[0m
  �[1mSTEP:�[0m syncing the application using the local dir �[38;5;243m@ 07/01/26 19:13:07.83�[0m
  executing command [argocd app sync app-kustomize-gitops-e2e-test-0421a642-e6ce --local /tmp/gitops-prune-test3191198142 --timeout 100]
  {"level":"warning","msg":"Failed to invoke grpc call. Use flag --grpc-web in grpc calls. To avoid this warning message, use flag --grpc-web.","time":"2026-07-01T19:13:08Z"}
  {"level":"warning","msg":"Failed to invoke grpc call. Use flag --grpc-web in grpc calls. To avoid this warning message, use flag --grpc-web.","time":"2026-07-01T19:13:09Z"}

  Name:               openshift-gitops/app-kustomize-gitops-e2e-test-0421a642-e6ce
  Project:            default
  Server:             https://kubernetes.default.svc
  Namespace:          gitops-e2e-test-0421a642-e6ce
  URL:                https://openshift-gitops-server-openshift-gitops.apps.ci-op-hi6vh47s-3fe53.ocp-gitops-qe.com/applications/app-kustomize-gitops-e2e-test-0421a642-e6ce
  Source:
  - Repo:             file:///tmp/gitops-prune-test3191198142.git
    Target:           HEAD
    Path:             .
  SyncWindow:         Sync Allowed
  Sync Policy:        Manual
  Sync Status:        OutOfSync from HEAD
  Health Status:      Missing

  Operation:          Sync
  Sync Revision:      
  Phase:              Failed
  Start:              2026-07-01 19:13:09 +0000 UTC
  Finished:           2026-07-01 19:13:09 +0000 UTC
  Duration:           0s
  Message:            one or more objects failed to apply, reason: templates.template.openshift.io is forbidden: User "system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller" cannot create resource "templates" in API group "template.openshift.io" in the namespace "gitops-e2e-test-0421a642-e6ce"

  GROUP                  KIND      NAMESPACE                      NAME                    STATUS     HEALTH   HOOK  MESSAGE
  template.openshift.io  Template  gitops-e2e-test-0421a642-e6ce  redis-template-gitops2  OutOfSync  Missing        templates.template.openshift.io is forbidden: User "system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller" cannot create resource "templates" in API group "template.openshift.io" in the namespace "gitops-e2e-test-0421a642-e6ce"
  template.openshift.io  Template  gitops-e2e-test-0421a642-e6ce  redis-template-gitops   OutOfSync  Missing        templates.template.openshift.io is forbidden: User "system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller" cannot create resource "templates" in API group "template.openshift.io" in the namespace "gitops-e2e-test-0421a642-e6ce"
  {"level":"fatal","msg":"Operation has completed with phase: Failed","time":"2026-07-01T19:13:10Z"}

  �[38;5;9m[FAILED]�[0m in [It] - /go/src/github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/sequential/1-084_validate_prune_templates.go:173 �[38;5;243m@ 07/01/26 19:13:10.261�[0m
  executing command: [kubectl logs pod/openshift-gitops-operator-controller-manager-7f5ccf96d9-wtwnx manager -n openshift-gitops-operator]

Signed-off-by: Jonathan West <jgwest@gmail.com>
@openshift-ci openshift-ci Bot added the kind/failing-test Categorizes issue or PR as related to a frequently failing test. label Jul 1, 2026
@openshift-ci openshift-ci Bot requested review from Naveena-058 and varshab1210 July 1, 2026 23:11
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Improved end-to-end validation by waiting for the expected Argo CD server access binding to appear in the managed namespace before continuing.
    • Added stronger checks around namespace setup to make the test more reliable and less prone to timing-related failures.

Walkthrough

This change updates an e2e test file to add imports for k8s fixture utilities and RBAC v1 API types, then inserts an Eventually wait in the BeforeEach block to confirm the operator creates the expected Argo CD server RoleBinding in the managed namespace before test execution proceeds.

Changes

RoleBinding Readiness Wait

Layer / File(s) Summary
Add RoleBinding wait in BeforeEach
test/openshift/e2e/ginkgo/sequential/1-084_validate_prune_templates.go
Adds imports for k8s fixture and RBAC v1 types, and inserts an Eventually wait that checks for the existence of the openshift-gitops-argocd-server RoleBinding in the managed namespace during BeforeEach setup.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: waiting for the RoleBinding in test 1-084 to reduce intermittent failures.
Description check ✅ Passed The description is directly related to the change and explains the flaky-test fix for waiting on the RoleBinding.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/openshift/e2e/ginkgo/sequential/1-084_validate_prune_templates.go`:
- Around line 52-58: The `Eventually` in `1-084_validate_prune_templates.go` is
still using Gomega’s default timeout, which can leave the RoleBinding wait
flaky. Update the wait around `argoCDServerRB` in the `By("waiting for the
operator to create rolebindings in the managed namespace")` block to use the
same explicit timeout/poll interval pattern used elsewhere in this test file for
operator-driven state, so the `ExistByName()` assertion has enough time to
succeed reliably.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 93338e2c-a349-4a34-9bd3-c6c9f3f69783

📥 Commits

Reviewing files that changed from the base of the PR and between fd47c94 and 166e166.

📒 Files selected for processing (1)
  • test/openshift/e2e/ginkgo/sequential/1-084_validate_prune_templates.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

@olivergondza

Copy link
Copy Markdown
Collaborator

/retest

@jgwest

jgwest commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

/retest

level=error msg=Error: creating IAM Role (ci-op-6njlp67i-42596-mvrll-bootstrap-role): LimitExceeded: Cannot exceed quota for RolesPerAccount: 1000
level=error msg=	status code: 409, request id: 8da968f3-75f5-4a4e-83cc-bd032eee54e6
level=error

@svghadi svghadi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@openshift-ci

openshift-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: svghadi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved label Jul 3, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 543c4f5 into redhat-developer:master Jul 3, 2026
17 checks passed
@openshift-ci

openshift-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown

@jgwest: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v4.19-ci-index-gitops-operator-bundle 166e166 link unknown /test v4.19-ci-index-gitops-operator-bundle
ci/prow/v4.19-e2e 166e166 link unknown /test v4.19-e2e
ci/prow/v4.19-kuttl-sequential 166e166 link unknown /test v4.19-kuttl-sequential
ci/prow/v4.19-kuttl-parallel 166e166 link unknown /test v4.19-kuttl-parallel

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

approved kind/failing-test Categorizes issue or PR as related to a frequently failing test. lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants