-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
e2e: ginkgo timeouts: use context provided by ginkgo #112923
Conversation
87a1701
to
3415e13
Compare
3415e13
to
4e541d2
Compare
@pohly: The following tests 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/test-infra repository. I understand the commands that are listed here. |
All code must use the context from Ginkgo when doing API calls or polling for a change, otherwise the code would not return immediately when the test gets aborted.
de45c39
to
2f6c4f5
Compare
/retest |
/retest "pull-kubernetes-e2e-capz-windows-containerd — Pod pending timeout" |
I tried my best to get to all files but there are 418 files changes, that is impossible, most of them are mechanical changes s/context.TODO/context gingo/ and we can always revert. I think that merging on weekend will give us some soak time to see if something breaks, so we can revert in that case /lgtm e2e framework should be able to stop cleanly |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, pohly 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 |
🙌 |
This is in preparation for kubernetes#112923: DeferCleanup will automatically do the right thing when testCleanup gets changed to require a context parameter.
This is in preparation for kubernetes#112923: DeferCleanup will automatically do the right thing when testCleanup gets changed to require a context parameter.
* Fix flaky HPA e2e tests by not failing on context cancelled Consume requests are sent during test execution in a loop in a separate goroutine. Once the test completes, it is expected that a consumption request may be pending. Cancelling the request during cleanup should not cause test failures. Tests started being flaky since #112923 introduced passing test context that gets cancelled during cleanup. * Use PollUntilContextTimeout and restructure error ignoring logic
…es#117669) * Fix flaky HPA e2e tests by not failing on context cancelled Consume requests are sent during test execution in a loop in a separate goroutine. Once the test completes, it is expected that a consumption request may be pending. Cancelling the request during cleanup should not cause test failures. Tests started being flaky since kubernetes#112923 introduced passing test context that gets cancelled during cleanup. * Use PollUntilContextTimeout and restructure error ignoring logic
…ancelled (kubernetes#117669) * Fix flaky HPA e2e tests by not failing on context cancelled Consume requests are sent during test execution in a loop in a separate goroutine. Once the test completes, it is expected that a consumption request may be pending. Cancelling the request during cleanup should not cause test failures. Tests started being flaky since kubernetes#112923 introduced passing test context that gets cancelled during cleanup. * Use PollUntilContextTimeout and restructure error ignoring logic
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Ginkgo can tell code to stop running by canceling the context that Ginkgo provides to callbacks when those accept one. This can be used to stop immediately when aborting manually via CTRL-C and to clean up properly in case of a timeout, because cleanup code then runs after the main test has stopped with a new context.
Special notes for your reviewer:
I started eliminating context.TODO in provisioning.go and then branched out from there: any function which had context.TODO needed an explicit context. The minimal goal for this PR is to clean up all code in test/e2e/framework because then further PRs probably can be more localized.
Does this PR introduce a user-facing change?