OLS-3238 - fixing product-e2e crash pod addition - #397
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughE2E execution now safely aggregates provider exit codes and provisions a verified crash-loop Pod in the staging namespace for both mock and real provider fixtures. ChangesE2E stability
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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/e2e/helpers_test.go`:
- Around line 159-174: Update the pod cleanup and recreation flow around
c.Delete, wait.PollUntilContextTimeout, c.Get, and T.Cleanup to propagate
failures instead of ignoring them. Treat only NotFound as an acceptable
delete/get result, fail the test on other API errors or polling timeout errors,
and ensure cleanup deletion errors are not discarded; only proceed to c.Create
after confirming the prior Pod is absent.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e17d2043-71bb-4691-a2ba-a1161323863e
📒 Files selected for processing (2)
scripts/e2e-cluster.shtest/e2e/helpers_test.go
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift/lightspeed-agentic-sandbox(manual)
| _ = c.Delete(ctx, pod) | ||
| // Wait briefly for any previous instance to terminate. | ||
| _ = wait.PollUntilContextTimeout(ctx, time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) { | ||
| var existing corev1.Pod | ||
| if err := c.Get(ctx, types.NamespacedName{Name: pod.Name, Namespace: pod.Namespace}, &existing); err != nil { | ||
| return true, nil | ||
| } | ||
| return false, nil | ||
| }) | ||
|
|
||
| if err := c.Create(ctx, pod); err != nil && !apierrors.IsAlreadyExists(err) { | ||
| t.Fatalf("create crash-loop pod: %v", err) | ||
| } | ||
| t.Cleanup(func() { | ||
| _ = c.Delete(context.Background(), pod) | ||
| }) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== locate file and relevant symbols =="
git ls-files | grep -E '(^|/)helpers_test\.go$|go\.mod$' || true
rg -n "ensureCrashLoopPod|staging/e2e-crasher|wait\.PollUntilContextTimeout|Delete\\(ctx, pod\\)|c\\.Delete\\(context\\.Background\\(\\), pod\\)" test/e2e/helpers_test.go || true
echo "== relevant helper section =="
sed -n '130,190p' test/e2e/helpers_test.go
echo "== call sites =="
rg -n "ensureCrashLoopPod\\(" test/e2e/helpers_test.go -C 5 || true
echo "== go.mod versions =="
rg -n "k8s\\.io/apimachinery|sigs\\.k8s\\.io/controller-runtime" go.mod test/e2e/go.mod 2>/dev/null || true
sed -n '1,160p' go.modRepository: openshift/lightspeed-agentic-operator
Length of output: 9886
Handle delete and polling failures before accepting an existing Pod.
c.Delete(ctx, pod)/Get(ctx, …) failures and PollUntilContextTimeout errors are currently swallowed, then the path can fall through to creating an existing Pod. This masks fixture cleanup failures and can reuse a stale staging/e2e-crasher Pod. Fail on non-NotFound delete/get/poll errors and stop discarding Delete/T.Cleanup errors.
🤖 Prompt for 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.
In `@test/e2e/helpers_test.go` around lines 159 - 174, Update the pod cleanup and
recreation flow around c.Delete, wait.PollUntilContextTimeout, c.Get, and
T.Cleanup to propagate failures instead of ignoring them. Treat only NotFound as
an acceptable delete/get result, fail the test on other API errors or polling
timeout errors, and ensure cleanup deletion errors are not discarded; only
proceed to c.Create after confirming the prior Pod is absent.
Source: Path instructions
|
@JoaoFula: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
No description provided.