-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🌱 Enable usetesting linter #12219
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?
🌱 Enable usetesting linter #12219
Conversation
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.
Seems reasonable, just switched context.TODO/Background
for t.Context
across many files
/lgtm
LGTM label has been added. Git tree hash: 9f4feb08815933df803ab6e77da92cf5d83d0aeb
|
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.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
@@ -17,7 +17,6 @@ limitations under the License. | |||
package alpha | |||
|
|||
import ( | |||
"context" | |||
"testing" |
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.
Do we know how this will work in combination with ctrl.SetupSignalHandler() that we use in many places?
Which context will be cancelled first? Will the shutdown still be somewhat clean?
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.
+ should we use either t.Context() or ctrl.SetupSignalHandler() everywhere? Or continue to have that mix that we currently have? Or do we know in which cases we would want to use which one
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.
t.Context() is canceled before t.Cleanup, then ctrl.SetupSignalHandler doesn't cancel until the signal is received. So it might be good to use properly. For example, how about is it ?
- ctrl.SetupSignalHandler should be only used when it's suite test.
- t.Context() should be only used other than suite test.
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.
Sorry will get back to this eventually. Just a lot of other things going on
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.
(low priority at the moment) I wonder if we could/should get rid of ctrl.SetupSignalHandler() entirely.
I wonder what the difference is between using t.Context and ctrl.SetupSignalHandler in suite_test.go.
Is one more graceful then the other? Maybe let's test this manually?
Context:
ctrl.SetupSignalHandler will cancel the context on the first signal and os.Exit(1) on the second. I don't know how tests with t.Context behave when the test binary receives signals
Signed-off-by: sivchari <shibuuuu5@gmail.com>
7f41e53
to
6056d61
Compare
New changes are detected. LGTM label has been removed. |
/area ci |
@sivchari: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
PR needs rebase. 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. |
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #12179