-
Notifications
You must be signed in to change notification settings - Fork 705
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
fix kinder smoke test #2118
Conversation
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 Once the patch is verified, the new status will be reflected by the 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. |
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.
@prasadkatti thanks for this PR
/ok-to-test |
// 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()) |
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 think we should remove this call.
and only leave the call on line 289. it prints only on a positive outcome (return true)
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.
okay 👍
time.Sleep(3 * time.Second) | ||
|
||
err = checkNodePort(c, nodePort) | ||
err = waitForNodePort(c, cp1, 30*time.Second, nodePort) |
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.
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
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.
one wait of handling that is passing wait / 2
to the 2 wait* calls.
it's default value is 5 minutes:
kubeadm/kinder/cmd/kinder/do/do.go
Line 104 in cf387fe
"wait", time.Duration(5*time.Minute), |
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 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.
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.
How difficult would it be to pass multiple try
funcs to the waitFor
so that this happens in parallel?
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.
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.
I had to change the label used to search for the pod from |
/lgtm @prasadkatti please squash commits, after that I will lift the hold |
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
@fabriziopandini - I have squashed the commits and force-pushed. |
/retest |
the previous failure in /lgtm |
[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 |
@neolit123 @fabriziopandini - Do we want to add smoke-test to ci? |
i think its not a bad idea. |
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. |
the only benefit would be to catch regressions in the smoke test, but i see your point. |
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) |
true, a separate CI job seems better. |
I was thinking at existing jobs not running e2e (e.g Kustomize if I remember well) |
kubectl run
withkubectl create deployment
fixes #2117