Skip to content

fix(kubernetes): remove readiness flag race in pod lifecycle test - #1737

Merged
skevetter merged 1 commit into
mainfrom
fix/kubernetes-pod-lifecycle-test-race
Oct 31, 2026
Merged

skevetter merged 1 commit into
mainfrom
fix/kubernetes-pod-lifecycle-test-race

Conversation

@skevetter

@skevetter skevetter commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Cause

TestReconcilePendingPodWaitsForReadiness set its ready flag after publishing the running pod. reconcile could return in between, so the assertion failed intermittently on main.

Fix

  • Set ready before putPod in the test goroutine.

Test evidence

6ea461e

  • go test ./pkg/driver/kubernetes/ -race -count=300 -run TestReconcilePendingPodWaitsForReadiness: ok
  • go test ./pkg/driver/kubernetes/... -race -count=1: ok
  • mise run cli:lint:ci: 0 issues

Summary by CodeRabbit

  • Tests
    • Updated automated coverage for Kubernetes pod readiness so the readiness state is set before the running pod update is observed. This change affects test setup only; it does not change application behavior or add end-user functionality.

@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 6ea461e
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ae56524ba76c3a04cf8df22

@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 6ea461e
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ae56524f657b761c0ded6ea

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2d271f96-1dcc-49e8-bc9c-fea9de3198d6
Commits

Reviewing files that changed from the base of the PR and between 6b01bf7 and 6ea461e.

Files selected for processing: 1
  • pkg/driver/kubernetes/pod_lifecycle_test.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The readiness test now sets ready = true before it publishes the updated running pod to the fake cluster.

Changes: Pod readiness test

Layer / File(s) Summary
Readiness test event order
pkg/driver/kubernetes/pod_lifecycle_test.go
The test goroutine sets ready = true before publishing the running pod.

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

Change: Bug fix

Possibly related PRs

  • devsy-org/devsy#1701: Adds the pod lifecycle implementation and readiness-wait test coverage that this change updates.

Suggested labels: bug, size/xs

Merge Risk: Minimal · up to 6ea46

The change aligns the readiness flag with pod publication in the test. No actionable merge-blocking issue is identified within the supplied scope.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the Kubernetes test race fix and follows the repository's Conventional Commits format.
Description check Passed The description explains the race condition, states the fix, and provides focused test and lint evidence. It omits several template sections, including issue linkage, checkboxes, AI-assistance details…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Description check

Explanation

The description explains the race condition, states the fix, and provides focused test and lint evidence. It omits several template sections, including issue linkage, checkboxes, AI-assistance details, and checklist confirmations, but the core information is complete for this small test-only change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@skevetter
skevetter enabled auto-merge (squash) October 31, 2026 04:17
@skevetter
skevetter merged commit 9bc12ee into main Oct 31, 2026
115 checks passed
@skevetter
skevetter deleted the fix/kubernetes-pod-lifecycle-test-race branch October 31, 2026 04:37

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Fixes a timing-dependent assertion in TestReconcilePendingPodWaitsForReadiness.

  • The readiness test signals readiness before publishing the running pod.

Reviews (1) · Last reviewed commit: "fix(kubernetes): remove readiness flag r..." · Reviewed by Greptile

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant