Skip to content

fix(ci): drop redundant api pod readiness wait in helm e2e#18

Open
lewisjared wants to merge 2 commits into
mainfrom
fix/ci-api-readiness-race
Open

fix(ci): drop redundant api pod readiness wait in helm e2e#18
lewisjared wants to merge 2 commits into
mainfrom
fix/ci-api-readiness-race

Conversation

@lewisjared

@lewisjared lewisjared commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The Test Helm Deployment job (packaging workflow) fails intermittently at the Validate API step, even though the API is healthy and serving traffic.

Cause

The step runs:

kubectl rollout restart deployment/test-climate-ref-aft-api
kubectl rollout status  deployment/test-climate-ref-aft-api --timeout=300s
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/component=api --timeout=60s

kubectl rollout status already blocks until the rollout is complete — i.e. the new pod is Ready. The subsequent kubectl wait --for=condition=Ready pod -l ... then re-selects all pods carrying the component=api label, which for a short window after rollout restart still includes the old, terminating pod. A terminating pod never reaches Ready, so the wait times out and fails the job — while the rollout has actually succeeded and the API is up.

Observed in three consecutive runs on a version-bump branch: the deployment reported 1 available | 0 unavailable, Available: True, "successfully rolled out", the API logged "Application startup complete" and served GET /health-check/ -> 200 throughout, yet kubectl wait timed out listing both the old-replicaset and new-replicaset pods.

Fix

Drop the redundant kubectl wait. rollout status is the readiness gate, and api_check.py already retries endpoint flaps during the rollout, so nothing downstream needs the extra wait.

Pure CI-reliability change; no application or chart behaviour is affected.

Summary by CodeRabbit

  • Bug Fixes
    • Improved deployment validation so the API test step now waits for the rollout to complete more reliably.
    • Reduced false timeouts during readiness checks after restarting the service.

The "Validate API" step ran `kubectl wait --for=condition=Ready pod
-l app.kubernetes.io/component=api` right after `kubectl rollout status`.
`rollout status` already blocks until the new pod is Ready, and the extra
wait re-selects every pod matching the label — including the old pod that
`rollout restart` is terminating. A terminating pod never reaches Ready, so
the wait timed out even though the rollout succeeded and the API was serving
traffic, failing the job intermittently.

Remove the redundant wait; `rollout status` is the readiness gate, and
api_check.py already retries endpoint flaps.
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@lewisjared, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b31a0fbd-9e7a-4da7-9858-42c2bd331fa3

📥 Commits

Reviewing files that changed from the base of the PR and between b6bb53e and 5fccded.

📒 Files selected for processing (1)
  • changelog/18.trivial.md
📝 Walkthrough

Walkthrough

The packaging workflow's "Validate API can read compute results" step was modified to remove a kubectl wait command targeting Ready pods via label selector, replacing it with reliance on kubectl rollout restart and kubectl rollout status, along with explanatory comments about the change.

Changes

Workflow rollout check update

Layer / File(s) Summary
Replace pod wait with rollout status check
.github/workflows/packaging.yaml
Removed the label-based kubectl wait --for=condition=Ready pod check and now relies solely on kubectl rollout restart and kubectl rollout status for deployment readiness, with added comments explaining the rationale.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the CI fix and the removal of the redundant API readiness wait.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-api-readiness-race

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.

❤️ Share

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.

🧹 Nitpick comments (1)
.github/workflows/packaging.yaml (1)

195-195: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor: double space in kubectl rollout status command.

Line 195 has a double space between status and deployment. Harmless for kubectl but worth tidying for consistency.

✏️ Proposed fix
-        kubectl rollout status  deployment/test-climate-ref-aft-api --timeout=300s
+        kubectl rollout status deployment/test-climate-ref-aft-api --timeout=300s

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 40c7bbcc-a4fa-4a8d-9249-92fa849e1fd9

📥 Commits

Reviewing files that changed from the base of the PR and between 9f25e62 and b6bb53e.

📒 Files selected for processing (1)
  • .github/workflows/packaging.yaml

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant