Skip to content
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

fix kinder smoke test #2118

Merged
merged 1 commit into from
Apr 29, 2020
Merged

fix kinder smoke test #2118

merged 1 commit into from
Apr 29, 2020

Conversation

prasadkatti
Copy link
Contributor

@prasadkatti prasadkatti commented Apr 27, 2020

  • Replace kubectl run with kubectl create deployment
  • Wait for service to be reachable before trying to access it

fixes #2117

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 27, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @prasadkatti. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 27, 2020
@prasadkatti prasadkatti changed the title try to fix the smoke test fix kinder smoke test Apr 27, 2020
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@prasadkatti thanks for this PR

@fabriziopandini
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 27, 2020
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 29, 2020
// nodePortIsReady implements a function that tests if a nodePort is ready
func nodePortIsReady(n *status.Node, port string) func(c *status.Cluster, n *status.Node) bool {
return func(c *status.Cluster, n *status.Node) bool {
fmt.Printf("checking node port %s on node %s...\n", port, n.Name())
Copy link
Member

Choose a reason for hiding this comment

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

i think we should remove this call.
and only leave the call on line 289. it prints only on a positive outcome (return true)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay 👍

time.Sleep(3 * time.Second)

err = checkNodePort(c, nodePort)
err = waitForNodePort(c, cp1, 30*time.Second, nodePort)
Copy link
Member

Choose a reason for hiding this comment

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

the old code iterated over all the nodes.

so this should be:

for _, n := range c.K8sNodes() {
	err = waitForNodePort(c, n, wait, nodePort)
	if err != nil {
		return err
	}
}

this makes wait is a bit odd in the context of SmokeTest() as a whole, because it is now used in a couple of "wait" locations, so it can wait for a maximum of wait * 2

Copy link
Member

@neolit123 neolit123 Apr 29, 2020

Choose a reason for hiding this comment

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

one wait of handling that is passing wait / 2 to the 2 wait* calls.
it's default value is 5 minutes:

"wait", time.Duration(5*time.Minute),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just kept the timeout to 30s for each of those calls. From what I saw the NodePort svc is ready within a couple of seconds. So the shorter timeout will help to fail fast.
The cluster that you get with when following the getting started guide has 3 nodes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How difficult would it be to pass multiple try funcs to the waitFor so that this happens in parallel?

Copy link
Member

Choose a reason for hiding this comment

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

waitFor already supports this, but is a bit difficult as this is the sequence ATM:

  • create deployment
  • wait for pod
  • expose port
  • wait for port

if we swap "expose port" / "wait for pod" the pod might not be ready yet and expose will fail.
so i'd say leave it the way it is.

@prasadkatti
Copy link
Contributor Author

I had to change the label used to search for the pod from run=nginx to app=nginx. This was a result of changing kubectl run to kubectl create deployment.

@fabriziopandini
Copy link
Member

/lgtm
/approve

@prasadkatti please squash commits, after that I will lift the hold
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 29, 2020
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 29, 2020
Replace `kubectl run` with `kubectl create deployment`
Wait for service to be reachable before trying to access it
Add a waiter to wait for NodePort to be ready
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2020
@prasadkatti
Copy link
Contributor Author

@fabriziopandini - I have squashed the commits and force-pushed.

@prasadkatti
Copy link
Contributor Author

/retest

@neolit123
Copy link
Member

neolit123 commented Apr 29, 2020

the previous failure in pull-kubeadm-kinder-upgrade-master is a flake in pulling artifacts, so this seems fine.

/lgtm
/approve
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 29, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, neolit123, prasadkatti

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 03018bb into kubernetes:master Apr 29, 2020
@prasadkatti
Copy link
Contributor Author

@neolit123 @fabriziopandini - Do we want to add smoke-test to ci?

@neolit123
Copy link
Member

i think its not a bad idea.
should be added above this line https://github.com/kubernetes/kubeadm/blob/master/kinder/ci/workflows/presubmit-upgrade-master.yaml#L117

@fabriziopandini
Copy link
Member

Smoke tests are more for the Devs than for Ci; in CI we are running the compliance suite and this is far more reliable than smoke tests, so IMO it is not necessary.

@neolit123
Copy link
Member

the only benefit would be to catch regressions in the smoke test, but i see your point.

@fabriziopandini
Copy link
Member

fabriziopandini commented Apr 29, 2020

What about having smoke test running in tests that are not required to do a full e2e (so use it as a light-weight alternative to e2e)

@neolit123
Copy link
Member

neolit123 commented Apr 29, 2020

true, a separate CI job seems better.

@fabriziopandini
Copy link
Member

I was thinking at existing jobs not running e2e (e.g Kustomize if I remember well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kinder do smoke-test fails
4 participants