-
Notifications
You must be signed in to change notification settings - Fork 166
Replace sleep with proper readiness check in TestInt_DialInClusterService #3238
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
base: main
Are you sure you want to change the base?
Replace sleep with proper readiness check in TestInt_DialInClusterService #3238
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: intojhanurag The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @intojhanurag. Thanks for your PR. I'm waiting for a github.com 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-sigs/prow repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3238 +/- ##
==========================================
+ Coverage 51.80% 54.55% +2.74%
==========================================
Files 162 162
Lines 19132 19132
==========================================
+ Hits 9912 10438 +526
+ Misses 8242 7655 -587
- Partials 978 1039 +61
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @lkingland , It is ready now . Can you review it , if you have a moment. |
creydr
left a comment
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.
Thanks for checking on this @intojhanurag
I left a comment.
pkg/k8s/dialer_int_test.go
Outdated
| func waitForDeploymentReady(ctx context.Context, cliSet *kubernetes.Clientset, namespace, deploymentName string, timeout time.Duration) error { | ||
| return wait.PollImmediate(2*time.Second, timeout, func() (bool, error) { | ||
| deploy, err := cliSet.AppsV1().Deployments(namespace).Get(ctx, deploymentName, metaV1.GetOptions{}) | ||
| if err != nil { | ||
| return false, err | ||
| } | ||
| if deploy.Status.ReadyReplicas == *deploy.Spec.Replicas { | ||
| return true, nil | ||
| } | ||
| return false, nil | ||
| }) | ||
| } |
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.
We have a similar function already existing for this:
Lines 21 to 30 in 84c2270
| func WaitForDeploymentAvailable(ctx context.Context, clientset *kubernetes.Clientset, namespace, deploymentName string, timeout time.Duration) error { | |
| return wait.PollUntilContextTimeout(ctx, 1*time.Second, timeout, true, func(ctx context.Context) (bool, error) { | |
| deployment, err := clientset.AppsV1().Deployments(namespace).Get(ctx, deploymentName, metav1.GetOptions{}) | |
| if err != nil { | |
| return false, err | |
| } | |
| return checkIfDeploymentIsAvailable(ctx, clientset, deployment) | |
| }) | |
| } |
|
Hey @creydr , Can you rerun the test ? I think this is a flake. |
|
/ok-to-test |
Fixed: #3211