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: service CLI command not honoring --wait arg #15735

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

elizabeth-dev
Copy link
Contributor

The minikube service CLI command has a --wait argument documented that enabled the user to wait the given seconds for a service to be available in the cluster, but this was being ignored.

The logic for waiting was already implemented, but was being overriden by an unneeded early return. I removed that, and added a test case that verifies this feature is working as intended, since it was untested.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: elizabeth-dev / name: Elizabeth Martín Campos (a1abe3c)

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 29, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @elizabeth-dev!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 29, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @elizabeth-dev. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 29, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 29, 2023
@elizabeth-dev
Copy link
Contributor Author

I found this while investigating issue #15644 , but it doesn't address the specific issue raised in there, so I didn't reference it in the PR. I read in the contributing docs that I should raise an issue before opening a PR, but since I already had a solution in mind, I decided to just go on with the PR. If an associated issue is really needed, I'll be happy to open it (and apologize for the caused inconveniences).

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 29, 2023
@spowelljr
Copy link
Member

Hi @elizabeth-dev, an issue is not necessary, there is a lint failure if you could fix that

@medyagh
Copy link
Member

medyagh commented Feb 2, 2023

thank you for this contribution @elizabeth-dev I am excited to try this out,

here is the lint issue that linter is complaining about:

Error: pkg/minikube/service/service_test.go:926:53: SA1012: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (staticcheck)
				_, _ = serviceNamespaces[test.namespace].Create(nil, &core.Service{
				          

@elizabeth-dev
Copy link
Contributor Author

@medyagh @spowelljr Yes, sorry, I meant to fix it, but I've been a bit busy these days and I haven't been able to open my personal laptop. I'll make the changes today.

The minikube service <service> CLI command has a --wait argument documented that enabled the user to wait the given seconds for a service to be available in the cluster, but this was being ignored.

The logic for waiting was already implemented, but was being overriden by an unneeded early return. I removed that, and added a test case that verifies this feature is working as intended, since it was untested.
@elizabeth-dev
Copy link
Contributor Author

@medyagh @spowelljr Fixed it, sorry for the delay

@medyagh
Copy link
Member

medyagh commented Feb 3, 2023

/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 Feb 3, 2023
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15735) |
+----------------+----------+---------------------+
| minikube start | 53.3s    | 54.4s               |
| enable ingress | 27.6s    | 26.4s               |
+----------------+----------+---------------------+

Times for minikube start: 53.8s 52.7s 52.4s 52.7s 55.1s
Times for minikube (PR 15735) start: 54.5s 54.2s 53.6s 55.4s 54.1s

Times for minikube ingress: 30.3s 29.2s 27.3s 25.2s 26.3s
Times for minikube (PR 15735) ingress: 24.2s 25.2s 28.7s 25.2s 28.7s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15735) |
+----------------+----------+---------------------+
| minikube start | 26.1s    | 26.2s               |
| enable ingress | 33.5s    | 34.8s               |
+----------------+----------+---------------------+

Times for minikube start: 27.3s 26.1s 25.9s 25.6s 25.8s
Times for minikube (PR 15735) start: 25.9s 26.8s 26.0s 25.7s 26.7s

Times for minikube ingress: 20.1s 21.1s 21.1s 82.6s 22.5s
Times for minikube (PR 15735) ingress: 22.0s 81.5s 21.1s 26.1s 23.1s

docker driver with containerd runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 15735) |
+-------------------+----------+---------------------+
| minikube start    | 22.1s    | 22.0s               |
| ⚠️  enable ingress | 31.7s    | 51.5s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube ingress: 31.6s 31.5s 31.5s 32.1s 31.6s
Times for minikube (PR 15735) ingress: 79.6s 31.6s 31.6s 32.6s 82.1s

Times for minikube start: 21.3s 22.3s 22.5s 22.5s 21.8s
Times for minikube (PR 15735) start: 21.7s 22.5s 21.4s 22.6s 21.9s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Linux_containerd TestDownloadOnlyKic (gopogh) 4.24 (chart)
Docker_Linux TestDownloadOnlyKic (gopogh) 4.27 (chart)
KVM_Linux TestMultiNode/serial/DeleteNode (gopogh) 6.17 (chart)
KVM_Linux TestMultiNode/serial/RestartKeepsNodes (gopogh) 9.26 (chart)
Docker_Windows TestRunningBinaryUpgrade (gopogh) 66.35 (chart)
Hyper-V_Windows TestRunningBinaryUpgrade (gopogh) 77.31 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressDNSAddonActivation (gopogh) 95.57 (chart)
Hyper-V_Windows TestStoppedBinaryUpgrade/Upgrade (gopogh) 98.32 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressAddons (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/StartLegacyK8sCluster (gopogh) 100.00 (chart)
Docker_macOS TestKubernetesUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestMissingContainerUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestRunningBinaryUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/AddonExistsAfterStop (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/DeployApp (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/EnableAddonWhileActive (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/FirstStart (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/SecondStart (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/UserAppExistsAfterStop (gopogh) 100.00 (chart)
Docker_macOS TestStoppedBinaryUpgrade/Upgrade (gopogh) 100.00 (chart)
Docker_Windows TestFunctional/parallel/ServiceCmd (gopogh) 100.00 (chart)
Hyper-V_Windows TestMultiNode/serial/PingHostFrom2Pods (gopogh) 100.00 (chart)
Hyper-V_Windows TestMultiNode/serial/RestartKeepsNodes (gopogh) 100.00 (chart)
Hyper-V_Windows TestNoKubernetes/serial/StartWithStopK8s (gopogh) 100.00 (chart)
KVM_Linux_containerd TestPreload (gopogh) 100.00 (chart)

To see the flake rates of all tests by environment, click here.

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

thank you for fixing this issue, look forward to see more contributions from you

@medyagh medyagh merged commit 5c0c9e8 into kubernetes:master Feb 10, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: elizabeth-dev, medyagh

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 10, 2023
@elizabeth-dev
Copy link
Contributor Author

thank you for fixing this issue, look forward to see more contributions from you

Thanks for the encouragement! I intend to do so in the future

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

6 participants