Skip to content

Conversation

@slyt3
Copy link

@slyt3 slyt3 commented Dec 4, 2025

Summary

WaitForPodsReady that was causing some of our flaky test issues. Basically, it was saying pods were ready when they weren't.

The Fix

Changed it to be more explicit about what "ready" actually means:

containerReady := false
podReady := false

for _, condition := range pod.Status.Conditions {
    if condition.Type == corev1.ContainersReady {
        containerReady = condition.Status == corev1.ConditionTrue
    }
    if condition.Type == corev1.PodReady {
        podReady = condition.Status == corev1.ConditionTrue
    }
}

if !containerReady {
    return fmt.Errorf("pod %s containers not ready", pod.Name)
}
if !podReady {
    return fmt.Errorf("pod %s not ready", pod.Name)
}

Now we're saying "prove to me the pods are ready" instead of "tell me if you see something wrong". Way safer. If the conditions aren't there or aren't true, we bail out properly.

Testing

  • It compiles without warning and zero static analysis warning (go build ./... && go vet)
  • Existing E2E tests pass

@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Dec 4, 2025
Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

LGTM, will merge when CI finishes

@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Dec 5, 2025
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.36%. Comparing base (0c0d907) to head (8127572).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2898   +/-   ##
=======================================
  Coverage   56.36%   56.36%           
=======================================
  Files         323      323           
  Lines       31764    31764           
=======================================
  Hits        17904    17904           
  Misses      12331    12331           
  Partials     1529     1529           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants