Skip to content

Conversation

olamilekan000
Copy link
Contributor

Summary

change replaces context.WithCancel with testing.T.Context

What Type of PR Is This?

/kind cleanup

Related Issue(s)

Fixes #

Release Notes

NONE

@kcp-ci-bot kcp-ci-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 19, 2025
@kcp-ci-bot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.


ctx, cancel := context.WithCancelCause(context.Background())
defer cancel(errors.New("test has ended"))
ctx := t.Context()
Copy link
Member

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.

Copy link
Contributor Author

@olamilekan000 olamilekan000 Sep 24, 2025

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?

Copy link
Contributor

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.

Copy link
Contributor Author

@olamilekan000 olamilekan000 Sep 24, 2025

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.

@olamilekan000 olamilekan000 requested a review from ntnn September 24, 2025 10:14
Signed-off-by: olalekan odukoya <odukoyaonline@gmail.com>
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign embik for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@olamilekan000 olamilekan000 requested a review from xrstf September 24, 2025 15:59
@mjudeikis
Copy link
Contributor

/ok-to-test

@kcp-ci-bot kcp-ci-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 3, 2025
@olamilekan000
Copy link
Contributor Author

/retest

@kcp-ci-bot
Copy link
Contributor

@olamilekan000: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kcp-lint c2a4c7a link true /test pull-kcp-lint
pull-kcp-test-e2e-shared c2a4c7a link true /test pull-kcp-test-e2e-shared
pull-kcp-test-e2e c2a4c7a link true /test pull-kcp-test-e2e
pull-kcp-test-e2e-sharded c2a4c7a link true /test pull-kcp-test-e2e-sharded
pull-kcp-test-e2e-multiple-runs c2a4c7a link true /test pull-kcp-test-e2e-multiple-runs

Full PR test history

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.

@mjudeikis
Copy link
Contributor

lint failure looks leggit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants