-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make integration.WaitForPodsReady use pod Ready
condition
#5308
Make integration.WaitForPodsReady use pod Ready
condition
#5308
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5308 +/- ##
==========================================
- Coverage 71.82% 71.81% -0.01%
==========================================
Files 392 392
Lines 14215 14219 +4
==========================================
+ Hits 10210 10212 +2
- Misses 3255 3257 +2
Partials 750 750
Continue to review full report at Codecov.
|
Tests are failing as expected since #5307 isn't committed \o/ |
var waiting []string | ||
for _, podName := range podNames { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this cause any issues when waitForAllPods is true? I'm just thinking that maybe a pod goes through all the necessary phases before any other and so it ends up being the only one in podNames
resulting in waiting
being empty despite there potentially being more pods who haven't reached a phase yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true: there is a race condition where pod creation events are pending in the watcher. I guess I could check len(w.ResultChan())
to see if there are other events pending.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope these pods will eventually reach a fixpoint :-/ I suppose we do have a timeout. I print out how many pending messages there are.
(note: tests should fail as still haven't merged with HEAD to pick up #5307) |
Towards #5249
Merge after: #5307 because
debug
tests will fail due to dlv/go1.12 breakage #5300Description
WaitForPodsReady
usesWaitForPodsInPhase
to check that the pods' phases areRunning
. But this does not account for readiness probes. It also turns out that ourwaitForDebugEvents()
callsWaitForPodsReady()
with no pod names, expecting it to wait for all pods to be ready.This PR splits out
WaitForPodsReady()
into a utilitywaitForPods()
that takes a predicate and waits for pods to satisfy that predicate.WaitForPodsReady()
calls intowaitForPods()
with a predicate that waits for the pod'sReady
condition to become true.WaitForPodsInPhase()
calls intowaitForPods()
with predicate that checks the pod's phase.waitForPods()
takes a list of pod names to monitor, and if empty then it waits for all pods (in that namespace).