Skip to content

tests: wait_for_registry: use oc rollout status - #11487

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
mmilata:extended-tests-wait-for-registry
Nov 3, 2016
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
mmilata:extended-tests-wait-for-registry

Conversation

@mmilata

@mmilata mmilata commented Oct 21, 2016

Copy link
Copy Markdown
Contributor

Prevents the function from hanging when observedGeneration is higher than the number we're waiting for.

Fixes #11406
Related to #11410

Comment thread hack/util.sh Outdated
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))"

@stevekuznetsov stevekuznetsov Oct 21, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair enough, thanks for explanation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@stevekuznetsov you can use rollout status --revision and pin to a specific (in our case 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So all we need here is:

oc rollout status dc/docker-registry --revision=1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure about what comment are you talking about but you can still use oc rollout status wherever you need this helper.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right, but in that case setting the version to 1 wouldn't work, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm also ok replacing those other uses of this function with calls to oc rollout status if if does everything we need

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@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).

@PI-Victor

Copy link
Copy Markdown
Contributor

i was hoping the discussion for this PR wouldn't get stuck so that i can run my tests locally without a headache :)
/resume?

@0xmichalis

Copy link
Copy Markdown
Contributor

@mmilata can you update this? I would suggest remove the registry helper and use oc rollout status directly.

@mmilata
mmilata force-pushed the extended-tests-wait-for-registry branch from 51b2c18 to 6582977 Compare November 2, 2016 16:12
@mmilata

mmilata commented Nov 2, 2016

Copy link
Copy Markdown
Contributor Author

@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.

@0xmichalis

Copy link
Copy Markdown
Contributor

@Kargakis PTAL ... or did you want me to remove the part that checks readiness as well?

Yes, it's redundant

Note: in case of registry deployment failure this commit effectively increases the timeout from 5 to 10 minutes.

If you want the same timeout as now, set TimeoutSeconds in the deployment strategy before creating the registry.

@mmilata
mmilata force-pushed the extended-tests-wait-for-registry branch from 6582977 to ce230c9 Compare November 2, 2016 17:33
@mmilata

mmilata commented Nov 2, 2016

Copy link
Copy Markdown
Contributor Author

@Kargakis updated, PTAL

@0xmichalis

Copy link
Copy Markdown
Contributor

LGTM [test]

Comment thread test/extended/gssapi.sh Outdated

install_registry
wait_for_registry
oc rollout status dc/docker-registry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Expect success here since you're in a jUnit context

Comment thread test/extended/cmd.sh

install_registry
wait_for_registry
oc rollout status dc/docker-registry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Expect success here since you're in a jUnit context

@mmilata
mmilata force-pushed the extended-tests-wait-for-registry branch from ce230c9 to afedcc2 Compare November 2, 2016 17:55
@mmilata

mmilata commented Nov 2, 2016

Copy link
Copy Markdown
Contributor Author

@stevekuznetsov fixed

Prevents the function from hanging when observedGeneration is higher
than the number we're waiting for.
@mmilata
mmilata force-pushed the extended-tests-wait-for-registry branch from afedcc2 to 20e033a Compare November 2, 2016 18:09
@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 20e033a

@openshift-bot

Copy link
Copy Markdown
Contributor

@0xmichalis

Copy link
Copy Markdown
Contributor

@mfojtik or @liggitt merge?

@mfojtik

mfojtik commented Nov 3, 2016

Copy link
Copy Markdown
Contributor

@mmilata

mmilata commented Nov 3, 2016

Copy link
Copy Markdown
Contributor Author

@mfojtik the junit context actually starts few lines after the change (we've discussed this on IRC, sorry).

@liggitt

liggitt commented Nov 3, 2016

Copy link
Copy Markdown
Contributor

LGTM, [merge]

@openshift-bot

openshift-bot commented Nov 3, 2016 •

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11018/) (Image: devenv-rhel7_5307)

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to 20e033a

@openshift-bot
openshift-bot merged commit 375f068 into openshift:master Nov 3, 2016
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.

7 participants