-
Notifications
You must be signed in to change notification settings - Fork 40.6k
[WIP] refactor: watch test cleanup #131457
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: master
Are you sure you want to change the base?
Conversation
27362ea
to
4a7f3e7
Compare
/assign @wojtek-t |
4a7f3e7
to
6a3066b
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: karlkfi 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 |
6a3066b
to
027ecc2
Compare
@karlkfi Thanks for the refactor. Is it possible to break this huge PR to smaller PRs or even commits? |
Sure. I'll see what i can do. Might have to mostly just be separate commits tho, because making changes to the file causes it to be linted, which requires fixing a lot of different things in the same PR. |
027ecc2
to
410e6e3
Compare
Split into three commits for a first pass. This modifies more files tho, which might surface other hidden linter errors. I can probably split the third commit down a bit more, pulling out the sub-tests, close helpers, and testify usage. |
/triage accepted |
410e6e3
to
55fb9c7
Compare
I split up the commits a bit more. |
Surprisingly, the request methods didn't cause additional linter failures by themselves, so i pulled those out to a seperate PR: #131656 You can approve that one first or this whole one. Whichever you prefer. If that one merges first, I'll rebase this one. |
142d6c9
to
c629d9c
Compare
- Use sub-tests to avoid side-effects between test cases, cancel the context between cases, and make it easier to determine the failing case in the test logs. - Use anonymous closures in benchmarks, instead of sub-tests, so the times still include all cases.
- Wait for storage watcher to be created by the watcher server before trying to send events to it in the tests.
- Use require and assert to make the tests easier to read and debug
- Close response body after http calls in the watch tests - Add apitesting utility methods for closing and testing errors from response body and websocket. - Validate read after close errors.
c629d9c
to
f99076c
Compare
@karlkfi: 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 type of PR is this?
/kind cleanup
/kind flake
What this PR does / why we need it:
This change fixes a bunch of linter errors in the watch tests.
Does this PR introduce a user-facing change?
Dependencies