-
Notifications
You must be signed in to change notification settings - Fork 277
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]: refactor code to replace time.Now() with Now() in clock package in pkg/scheduler(#3380) #3421
[fix]: refactor code to replace time.Now() with Now() in clock package in pkg/scheduler(#3380) #3421
Conversation
Welcome @TusharMohapatra07! |
Hi @TusharMohapatra07. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
cc @mbobrovskyi for first pass |
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.
- Don't forget to change
time.Since(...)
tos.clock.Since(...)
as well. - Please update scheduler_test.go using
FakeClock
instead of time. - Implement new
Option
to provideFakeClock
to scheduler.
@mbobrovskyi can you please elaborate on the |
55e1367
to
46c9979
Compare
We already have a few options on Scheduler kueue/pkg/scheduler/scheduler.go Lines 98 to 110 in 55e1367
So you need just to add one more like here kueue/pkg/controller/jobframework/reconciler.go Lines 194 to 201 in 55e1367
Yes, here https://kubernetes.slack.com/. |
@mbobrovskyi |
Try this https://slack.k8s.io/ |
@mbobrovskyi please check if the 1st and 3rd requirement are being fulfilled. about the 2nd one, is it similar to what's implemented here
|
Yes, exactly. |
/ok-to-test |
LGTM label has been added. Git tree hash: 0eaed30412bd4b2bc6ab9e89428d341f5929c67c
|
/kind cleanup |
/release-note-edit
|
@mbobrovskyi: /release-note-edit must be used with a single release note block. 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 kubernetes-sigs/prow repository. |
@TusharMohapatra07 Please add ```release-note on the PR description. |
/remove-kind feature flake |
/cc @mimowo |
@mbobrovskyi about the case that you asked me to cover kueue/pkg/scheduler/scheduler_test.go Line 2765 in f7d342b
|
Yeah, you right, it's not need. Thanks for investigation. |
@TusharMohapatra07 Also please remove WIP on PR title if it's ready to review. |
@mbobrovskyi what about other packages ? should i raise another pr for those ? i think it would be a good idea to make one PR for each package refactor |
Yes, feel free to follow up on separate PRs. |
@mbobrovskyi done |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mimowo, TusharMohapatra07 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 |
…e in pkg/scheduler(kubernetes-sigs#3380) (kubernetes-sigs#3421) * refactor time.Now() in pkg/scheduler * replace time.Since() with Since() present in clock package * add new option to provide fakeclock to scheduler * add realClock to options and pass in fakeClock while testing * use options.clock instead of realClock * add more fakeClock(s)
What type of PR is this?
/kind feature
/kind flake
What this PR does / why we need it:
Replaces
time.Now()
to use the Now() function present insideclock
packageWhich issue(s) this PR fixes:
Fixes #3380
Special notes for your reviewer:
This PR is work-in-progress. I've refactored the code inside
pkg/scheduler
for now. I shall proceed to refactor more post review.