Repository navigation
tests: wait_for_registry: use oc rollout status - #11487
Conversation
| local generation="$(oc get dc/docker-registry -o 'jsonpath={.metadata.generation}')" | ||
| local onereplicajs='{.status.observedGeneration},{.status.replicas},{.status.updatedReplicas},{.status.availableReplicas}' | ||
| wait_for_command "oc get dc/docker-registry -o 'jsonpath=${onereplicajs}' --config='${ADMIN_KUBECONFIG}' | grep '^${generation},1,1,1$'" "$((5*TIME_MIN))" | ||
| wait_for_command "oc rollout status dc/docker-registry --request-timeout=1m" "$((5*TIME_MIN))" |
There was a problem hiding this comment.
As @liggitt mentioned, one of the core functional bits of this method is the fact that it's pegging to a specific generation and waiting for that generation to be ready. oc rollout status may be appropriate in the initial deploy & wait for readiness stage where we just care that it's running, but not in the update stages where we care about which version is running.
There was a problem hiding this comment.
Fair enough, thanks for explanation.
There was a problem hiding this comment.
@stevekuznetsov you can use rollout status --revision and pin to a specific (in our case 1)
There was a problem hiding this comment.
We also don't need to wait and use a separate timeout since oc rollout status uses a watch until the rollout is finished which means the deployment timeout is used implicitly.
There was a problem hiding this comment.
So all we need here is:
oc rollout status dc/docker-registry --revision=1
There was a problem hiding this comment.
Not sure about what comment are you talking about but you can still use oc rollout status wherever you need this helper.
There was a problem hiding this comment.
Right, but in that case setting the version to 1 wouldn't work, right?
There was a problem hiding this comment.
There was a problem hiding this comment.
I'm also ok replacing those other uses of this function with calls to oc rollout status if if does everything we need
There was a problem hiding this comment.
@stevekuznetsov here is my reply at #11410 (comment)
We don't even need a separate helper for waiting for dc/xxxx to be ready now. Let's just use oc rollout status (waits for a complete status on top of a synced config (dc.generation <= dc.status.observedGeneration).
|
i was hoping the discussion for this PR wouldn't get stuck so that i can run my tests locally without a headache :) |
|
@mmilata can you update this? I would suggest remove the registry helper and use |
51b2c18 to
6582977
Compare
|
@Kargakis PTAL ... or did you want me to remove the part that checks readiness as well? Note: in case of registry deployment failure this commit effectively increases the timeout from 5 to 10 minutes. |
Yes, it's redundant
If you want the same timeout as now, set TimeoutSeconds in the deployment strategy before creating the registry. |
6582977 to
ce230c9
Compare
|
@Kargakis updated, PTAL |
|
LGTM [test] |
|
|
||
| install_registry | ||
| wait_for_registry | ||
| oc rollout status dc/docker-registry |
There was a problem hiding this comment.
Expect success here since you're in a jUnit context
|
|
||
| install_registry | ||
| wait_for_registry | ||
| oc rollout status dc/docker-registry |
There was a problem hiding this comment.
Expect success here since you're in a jUnit context
ce230c9 to
afedcc2
Compare
|
@stevekuznetsov fixed |
Prevents the function from hanging when observedGeneration is higher than the number we're waiting for.
afedcc2 to
20e033a
Compare
|
Evaluated for origin test up to 20e033a |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11018/) (Base Commit: cf6ed4b) |
|
@mmilata can you address https://github.com/openshift/origin/pull/11487/files#r86203222 ? I'm fine with merging this after that. |
|
@mfojtik the junit context actually starts few lines after the change (we've discussed this on IRC, sorry). |
|
LGTM, [merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11018/) (Image: devenv-rhel7_5307) |
|
Evaluated for origin merge up to 20e033a |
Prevents the function from hanging when observedGeneration is higher than the number we're waiting for.
Fixes #11406
Related to #11410