-
Notifications
You must be signed in to change notification settings - Fork 421
update test context.WithCancel with testing.T.Context #3583
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?
Conversation
Hi @olamilekan000. Thanks for your PR. I'm waiting for a kcp-dev 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/test-infra repository. |
af48695
to
e8fc8b3
Compare
e8fc8b3
to
8c7f9c9
Compare
|
||
ctx, cancel := context.WithCancelCause(context.Background()) | ||
defer cancel(errors.New("test has ended")) | ||
ctx := t.Context() |
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.
Please replace uses of ctx
with t.Context()
- cases where we used ctx, cancel := ...
was only due to needing access to cancel
.
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.
There's only one occurance of context.WithCancelCause
at the moment and the reason it wasn't changed is because the cancel function is being assigned as a field in authenticatorState
.
c.authConfigAuthenticators[shard][mapKey] = authenticatorState{
cancel: cancel,
authenticator: authn,
}
should it be removed?
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 cancel func needs to remain in the authState, or else the front-proxy will not be able to stop OIDC authenticators at runtime. But this should not affect this test function at all.
I would say you changed this test function here exactly as expected.
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.
Actually, the part of the code I shared doesn't need to change. There are no longer usage of context.WithCancelCause
for test in this branch.
Signed-off-by: olalekan odukoya <odukoyaonline@gmail.com>
8c7f9c9
to
c2a4c7a
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
/ok-to-test |
/retest |
@olamilekan000: The following tests failed, say
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. I understand the commands that are listed here. |
lint failure looks leggit |
Summary
What Type of PR Is This?
/kind cleanup
Related Issue(s)
Fixes #
Release Notes