-
Notifications
You must be signed in to change notification settings - Fork 111
NO-JIRA:e2e:daemonset: pod phase and events #1289
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
NO-JIRA:e2e:daemonset: pod phase and events #1289
Conversation
testlog.Infof("daemonset %q %q desired %d scheduled %d ready %d", namespace, name, ds.Status.DesiredNumberScheduled, ds.Status.CurrentNumberScheduled, ds.Status.NumberReady) | ||
return ds.Status.DesiredNumberScheduled > 0 && ds.Status.DesiredNumberScheduled == ds.Status.NumberReady, nil | ||
isRunning := ds.Status.DesiredNumberScheduled > 0 && ds.Status.DesiredNumberScheduled == ds.Status.NumberReady | ||
if !isRunning { |
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.
style: everything else being equal, please align the happy path to the left: https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea88
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 happy path is isRunning == true
which is the opposite of !isRunning
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 moved the logic into a separate function to make it more readable. I hope it's ok now
test/e2e/performanceprofile/functests/utils/daemonset/daemonset.go
Outdated
Show resolved
Hide resolved
3e0bea5
to
963cc89
Compare
thanks, we can go a step further (ofc not blocking)
|
Could you please highlight the diff from the existing implementation? |
963cc89
to
7de0434
Compare
basically same logic, but keep pushing the happy path leftwards |
it does. unless I'm missing something |
/retest |
/approve |
/label acknowledge-critical-fixes-only test code can't break the product and actually helps improving the product quality |
testlog.Infof("wait for the daemonset %q %q to be running", namespace, name) | ||
return wait.PollUntilContextTimeout(context.TODO(), 10*time.Second, timeout, true, func(ctx context.Context) (bool, error) { | ||
return IsRunning(cli, namespace, name) | ||
return wait.PollUntilContextTimeout(ctx, 30*time.Second, timeout, true, func(ctx2 context.Context) (bool, error) { |
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.
nit : I would use a more meaningful name than ctx2 (e.g. timeoutCtx or derivedCtx)
Add context from the caller instead of local `context.TODO()`. Signed-off-by: Talor Itzhak <[email protected]>
Signed-off-by: Talor Itzhak <[email protected]>
less iterations means less spamming especially within the nodeinspector which log some data for every iteration. Signed-off-by: Talor Itzhak <[email protected]>
In case the DaemonSet's pods are not running for some reason, we want to log the pod's phase and event for better observability. This could help us with finding the root cause for the reason the pod didn't start. Signed-off-by: Talor Itzhak <[email protected]>
7de0434
to
1899f7e
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ffromani, Tal-or 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 |
/retest |
1 similar comment
/retest |
/lgtm |
@Tal-or: This pull request explicitly references no jira issue. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
@Tal-or: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
[ART PR BUILD NOTIFIER] Distgit: cluster-node-tuning-operator |
In case the DaemonSet's pods are not running for some reason,
we want to log the pod's phase and event for
better observability.
This could help us with finding the root cause
for the reason the pod didn't start.
Signed-off-by: Talor Itzhak [email protected]