Skip to content
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

fix test store delete collection function failed #121780

Merged

Conversation

HirazawaUi
Copy link
Contributor

@HirazawaUi HirazawaUi commented Nov 7, 2023

What type of PR is this?

/kind failing-test

What this PR does / why we need it:

Once we make the GetList in DeleteCollection respect the timeout context, here's what makes the other test functions fail

Which issue(s) this PR fixes:

Fixes #121627

Special notes for your reviewer:

deleteCollectionPageSize = 2 will overwrite the value of the global variable deleteCollectionPageSize, causing other tests to fail, so after we execute this test function, we reset it to its default value int64(10000)

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 7, 2023
@HirazawaUi
Copy link
Contributor Author

/assign @wojtek-t

@@ -2042,6 +2042,9 @@ func TestStoreDeleteCollection(t *testing.T) {
storeWithCounter := &storageWithCounter{Interface: registry.Storage.Storage}
registry.Storage.Storage = storeWithCounter
deleteCollectionPageSize = 2
defer func() {
deleteCollectionPageSize = int64(10000)
}()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great finding. Instead of setting 10000 value here, can you please restore to the value to which it was set before?
So sth like:

originalDeleteCollectionPageSize = deleteCollectionPageSize
deleteCollectionPageSize = 2
defer func() {
  deleteCollectionPageSize = originalDeleteCollectionPageSize
}()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all right!

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 7, 2023
@wojtek-t
Copy link
Member

wojtek-t commented Nov 7, 2023

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 7, 2023
@HirazawaUi HirazawaUi force-pushed the fix-delete-collection-test-failed branch from 870f830 to b12db6d Compare November 7, 2023 16:35
@wojtek-t
Copy link
Member

wojtek-t commented Nov 7, 2023

/lgtm
/approve

/milestone v1.29
Test-only change and we're still before test-freeze.

@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Nov 7, 2023
@wojtek-t
Copy link
Member

wojtek-t commented Nov 7, 2023

/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 7, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 63a4664f482992dfa4c9a83033866d444ea85a72

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HirazawaUi, wojtek-t

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 7, 2023
@k8s-ci-robot k8s-ci-robot merged commit f927d5b into kubernetes:master Nov 7, 2023
14 checks passed
@alexzielenski
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failing-test: TestStoreDeleteCollectionWithContextCancellation
4 participants