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

add repetition loop to test idempotency #229

Merged
merged 3 commits into from
Mar 17, 2020

Conversation

okartau
Copy link
Contributor

@okartau okartau commented Oct 18, 2019

Repeated volume operations helps to test the idempotency requirement.

What type of PR is this?
/kind feature

What this PR does / why we need it:

CSI spec requires driver to tolerate repeated volume operations by the idempotency requirements.
In pmem-csi driver context we discovered that some volume operations failed when requests were repeated. i.e. we failed to conform to idempotency requirements. However, the test suite does not repeat volume options in most cases, so here is attempt to add this.
There is config option that makes it possible to select repeat count, or bypass the repeated part.

Does this PR introduce a user-facing change?:

If a component using csi-test does not implement all idempotency requirements, this addition may start to expose some new failures.

Added (optional) repeated operations to test idempotency

@k8s-ci-robot
Copy link
Contributor

Welcome @okartau!

It looks like this is your first PR to kubernetes-csi/csi-test 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-csi/csi-test has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 18, 2019
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 18, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @okartau. Thanks for your PR.

I'm waiting for a kubernetes-csi or kubernetes 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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 18, 2019
@pohly
Copy link
Contributor

pohly commented Oct 18, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot 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 18, 2019
Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

Please add a release note in the PR description. This is worth mentioning when doing the next csi-test release.

The test-fmt checking failed in the Travis CI.

@okartau okartau force-pushed the add-nodetests-repeat-loop branch from 9759bf8 to 2192bee Compare October 20, 2019 12:10
@okartau
Copy link
Contributor Author

okartau commented Oct 20, 2019

The failure in
https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/kubernetes-csi_csi-test/229/pull-kubernetes-csi-csi-test/1185891170576764931
seems to point out the idempotency related issue in the hostpath driver, where repated NodeUnpublish does not succeed?
We had a similar one in pmem-csi when I started to add those repeated tests.

@pohly
Copy link
Contributor

pohly commented Oct 21, 2019

The failure in
https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/kubernetes-csi_csi-test/229/pull-kubernetes-csi-csi-test/1185891170576764931
seems to point out the idempotency related issue in the hostpath driver, where repated NodeUnpublish does not succeed?

In that case we'll have to fix the hostpath driver first such that it passes these new tests.

@pohly
Copy link
Contributor

pohly commented Oct 21, 2019

Please add a release note in the PR description.

Still open.

@pohly
Copy link
Contributor

pohly commented Oct 21, 2019

/assign

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Oct 23, 2019
@okartau
Copy link
Contributor Author

okartau commented Oct 23, 2019

Please add a release note in the PR description.

Still open.

I added a short note, is this good?

@pohly
Copy link
Contributor

pohly commented Oct 28, 2019

repeated Node Volume operations

That note made me realized that the repetition count really is only applied to node operations - somehow I missed that earlier.

All operations must be idempotent, including CreateVolume and ControllerPublishVolume. Can you add that and update the changelog entry accordingly?

It would be nicer if the idempotency test wasn't under node.go because some CSI driver might only support the controller operations (for example, during initial development), but I think it's okay as it is because eventually the node operations are needed and then one can run the test.

@okartau okartau force-pushed the add-nodetests-repeat-loop branch from 2192bee to eb1c453 Compare January 14, 2020 09:29
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 14, 2020
@okartau okartau changed the title sanity/node.go: add repetition loop to test idempotency WIP: sanity/node.go: add repetition loop to test idempotency Jan 14, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 14, 2020
@okartau okartau force-pushed the add-nodetests-repeat-loop branch from eb1c453 to 891853c Compare January 14, 2020 10:56
VolumeUnpublish test sequence repeats exactly steps
that are already made in VolumePublish, so we can
omit the 2nd sequence as it adds no new value.
@okartau okartau force-pushed the add-nodetests-repeat-loop branch from 07e422d to 151ee8c Compare March 4, 2020 07:41
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 4, 2020
@okartau
Copy link
Contributor Author

okartau commented Mar 4, 2020

Pushed version with Volume lifecycle separated as function which can be called with repeat-count argument. Also, removing the duplicate part from Unpublish side, in separate commit.
I think we can improve It and By strings a bit, currently used
It("should return appropriate values (no optional values added)"
(which I did not changed yet in this PR)
seems to be used as copied around template used in many places and not a good fit,
as we are not checking any optional values in that code.

pkg/sanity/controller.go Outdated Show resolved Hide resolved
@okartau okartau force-pushed the add-nodetests-repeat-loop branch 2 times, most recently from d06296e to e5efdca Compare March 12, 2020 15:29
@okartau
Copy link
Contributor Author

okartau commented Mar 12, 2020

This lacked skip check so it failed the CI run. Added skip andtry pushed.
Q: Is the location of those what I called "Lifecycle" tests now good, it's between Publish and Unpublish tests. Or would it be better to put it after Unpublish part.

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

Is the location of those what I called "Lifecycle" tests now good, it's between Publish and Unpublish tests. Or would it be better to put it after Unpublish part.

I don't have a strong preference either way. Let's just keep it where it is.

Some minor nits, otherwise looking good now.

pkg/sanity/controller.go Outdated Show resolved Hide resolved
pkg/sanity/controller.go Outdated Show resolved Hide resolved
Add idempotency-testing loops for controller operations.
Move Create-Publish-Unpublish-Delete cycle into a function,
which is called with argument specifying repetition count.
@okartau okartau force-pushed the add-nodetests-repeat-loop branch from e5efdca to 7dd8c55 Compare March 13, 2020 17:26
@okartau
Copy link
Contributor Author

okartau commented Mar 13, 2020

addressed latest comments and force-pushed.

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 13, 2020
@pohly
Copy link
Contributor

pohly commented Mar 13, 2020

Let's see if someone else has an opinion about this. If not, then I'll approve.

@pohly
Copy link
Contributor

pohly commented Mar 17, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: okartau, 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 /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 Mar 17, 2020
@k8s-ci-robot k8s-ci-robot merged commit 8f687ee into kubernetes-csi:master Mar 17, 2020
pohly added a commit to pohly/pmem-CSI that referenced this pull request May 20, 2020
This imports the idempotency
tests (kubernetes-csi/csi-test#229).
pohly added a commit to pohly/pmem-CSI that referenced this pull request May 20, 2020
This imports the idempotency
tests (kubernetes-csi/csi-test#229).
pohly added a commit to pohly/pmem-CSI that referenced this pull request May 20, 2020
This imports the idempotency
tests (kubernetes-csi/csi-test#229).
pohly added a commit to intel/pmem-csi that referenced this pull request May 25, 2020
This imports the idempotency
tests (kubernetes-csi/csi-test#229).
pohly added a commit to pohly/pmem-CSI that referenced this pull request May 26, 2020
This imports the idempotency
tests (kubernetes-csi/csi-test#229).
stmcginnis pushed a commit to stmcginnis/csi-test that referenced this pull request Oct 9, 2024
TerryHowe added a commit to TerryHowe/csi-test that referenced this pull request Oct 22, 2024
227577e Merge pull request kubernetes-csi#258 from gnufied/enable-race-detection
e1ceee2 Always enable race detection while running tests
988496a Merge pull request kubernetes-csi#257 from jakobmoellerdev/csi-prow-sidecar-e2e-path
028f8c6 chore: bump to Go 1.22.5
69bd71e chore: add CSI_PROW_SIDECAR_E2E_PATH
f40f0cc Merge pull request kubernetes-csi#256 from solumath/master
cfa9210 Instruction update
379a1bb Merge pull request kubernetes-csi#255 from humblec/sidecar-md
a5667bb fix typo in sidecar release process
4967685 Merge pull request kubernetes-csi#254 from bells17/add-github-actions
d9bd160 Update skip list in codespell GitHub Action
adb3af9 Merge pull request kubernetes-csi#252 from bells17/update-go-version
f5aebfc Add GitHub Actions workflows
b82ee38 Merge pull request kubernetes-csi#253 from bells17/fix-typo
c317456 Fix typo
0a78505 Bump to Go 1.22.3
edd89ad Merge pull request kubernetes-csi#251 from jsafrane/add-logcheck
043fd09 Add test-logcheck target
d7535ae Merge pull request kubernetes-csi#250 from jsafrane/go-1.22
b52e7ad Update go to 1.22.2
14fdb6f Merge pull request kubernetes-csi#247 from msau42/prow
dc4d0ae Merge pull request kubernetes-csi#249 from jsafrane/use-go-version
e681b17 Use .go-version to get Kubernetes go version
9b4352e Update release playbook
c7bb972 Fix release notes script to use fixed tags
463a0e9 Add script to update specific go modules
b54c1ba Merge pull request kubernetes-csi#246 from xing-yang/go_1.21
5436c81 Change go version to 1.21.5
267b40e Merge pull request kubernetes-csi#244 from carlory/sig-storage
b42e5a2 nominate self (carlory) as kubernetes-csi reviewer
a17f536 Merge pull request kubernetes-csi#210 from sunnylovestiramisu/sidecar
011033d Use set -x instead of die
5deaf66 Add wrapper script for sidecar release
f8c8cc4 Merge pull request kubernetes-csi#237 from msau42/prow
b36b5bf Merge pull request kubernetes-csi#240 from dannawang0221/upgrade-go-version
adfddcc Merge pull request kubernetes-csi#243 from pohly/git-subtree-pull-fix
c465088 pull-test.sh: avoid "git subtree pull" error
7b175a1 Update csi-test version to v5.2.0
987c90c Update go version to 1.21 to match k/k
2c625d4 Add script to generate patch release notes
f9d5b9c Merge pull request kubernetes-csi#236 from mowangdk/feature/bump_csi-driver-host-path_version
b01fd53 Bump csi-driver-host-path version up to v1.12.0
984feec Merge pull request kubernetes-csi#234 from siddhikhapare/csi-tools
1f7e605 fixed broken links of testgrid dashboard
de2fba8 Merge pull request kubernetes-csi#233 from andyzhangx/andyzhangx-patch-1
cee895e remove windows 20H2 build since it's EOL long time ago
670bb0e Merge pull request kubernetes-csi#229 from marosset/fix-codespell-errors
35d5e78 Merge pull request kubernetes-csi#219 from yashsingh74/update-registry
63473cc Merge pull request kubernetes-csi#231 from coulof/bump-go-version-1.20.5
29a5c76 Merge pull request kubernetes-csi#228 from mowangdk/chore/adopt_kubernetes_recommand_labels
8dd2821 Update cloudbuild image with go 1.20.5
1df23db Merge pull request kubernetes-csi#230 from msau42/prow
1f92b7e Add ginkgo timeout to e2e tests to help catch any stuck tests
2b8b80e fixing some codespell errors
c10b678 Merge pull request kubernetes-csi#227 from coulof/check-sidecar-supported-versions
72984ec chore: adopt kubernetes recommand label
b055535 Header
bd0a10b typo
c39d73c Add comments
f6491af Script to verify EOL sidecar version
4133d1d Merge pull request kubernetes-csi#226 from msau42/cloudbuild
8d519d2 Pin buildkit to v0.10.6 to workaround v0.11 bug with docker manifest
6e04a03 Merge pull request kubernetes-csi#224 from msau42/cloudbuild
26fdfff Update cloudbuild image
6613c39 Merge pull request kubernetes-csi#223 from sunnylovestiramisu/update
0e7ae99 Update k8s image repo url
77e47cc Merge pull request kubernetes-csi#222 from xinydev/fix-dep-version
155854b Fix dep version mismatch
8f83905 Merge pull request kubernetes-csi#221 from sunnylovestiramisu/go-update
1d3f94d Update go version to 1.20 to match k/k v1.27
e322ce5 Merge pull request kubernetes-csi#220 from andyzhangx/fix-golint-error
b74a512 test: fix golint error
901bcb5 Update registry k8s.gcr.io -> registry.k8s.io

git-subtree-dir: release-tools
git-subtree-split: 227577e
TerryHowe added a commit to TerryHowe/csi-test that referenced this pull request Dec 6, 2024
734c2b9 Merge pull request kubernetes-csi#265 from Rakshith-R/consider-main-branch
f95c855 Merge pull request kubernetes-csi#262 from huww98/golang-toolchain
3c8d966 Treat main branch as equivalent to master branch
e31de52 Merge pull request kubernetes-csi#261 from huww98/golang
fd153a9 Bump golang to 1.23.1
a8b3d05 pull-test.sh: fix "git subtree pull" errors
6b05f0f use new GOTOOLCHAIN env to manage go version
227577e Merge pull request kubernetes-csi#258 from gnufied/enable-race-detection
e1ceee2 Always enable race detection while running tests
988496a Merge pull request kubernetes-csi#257 from jakobmoellerdev/csi-prow-sidecar-e2e-path
028f8c6 chore: bump to Go 1.22.5
69bd71e chore: add CSI_PROW_SIDECAR_E2E_PATH
f40f0cc Merge pull request kubernetes-csi#256 from solumath/master
cfa9210 Instruction update
379a1bb Merge pull request kubernetes-csi#255 from humblec/sidecar-md
a5667bb fix typo in sidecar release process
4967685 Merge pull request kubernetes-csi#254 from bells17/add-github-actions
d9bd160 Update skip list in codespell GitHub Action
adb3af9 Merge pull request kubernetes-csi#252 from bells17/update-go-version
f5aebfc Add GitHub Actions workflows
b82ee38 Merge pull request kubernetes-csi#253 from bells17/fix-typo
c317456 Fix typo
0a78505 Bump to Go 1.22.3
edd89ad Merge pull request kubernetes-csi#251 from jsafrane/add-logcheck
043fd09 Add test-logcheck target
d7535ae Merge pull request kubernetes-csi#250 from jsafrane/go-1.22
b52e7ad Update go to 1.22.2
14fdb6f Merge pull request kubernetes-csi#247 from msau42/prow
dc4d0ae Merge pull request kubernetes-csi#249 from jsafrane/use-go-version
e681b17 Use .go-version to get Kubernetes go version
9b4352e Update release playbook
c7bb972 Fix release notes script to use fixed tags
463a0e9 Add script to update specific go modules
b54c1ba Merge pull request kubernetes-csi#246 from xing-yang/go_1.21
5436c81 Change go version to 1.21.5
267b40e Merge pull request kubernetes-csi#244 from carlory/sig-storage
b42e5a2 nominate self (carlory) as kubernetes-csi reviewer
a17f536 Merge pull request kubernetes-csi#210 from sunnylovestiramisu/sidecar
011033d Use set -x instead of die
5deaf66 Add wrapper script for sidecar release
f8c8cc4 Merge pull request kubernetes-csi#237 from msau42/prow
b36b5bf Merge pull request kubernetes-csi#240 from dannawang0221/upgrade-go-version
adfddcc Merge pull request kubernetes-csi#243 from pohly/git-subtree-pull-fix
c465088 pull-test.sh: avoid "git subtree pull" error
7b175a1 Update csi-test version to v5.2.0
987c90c Update go version to 1.21 to match k/k
2c625d4 Add script to generate patch release notes
f9d5b9c Merge pull request kubernetes-csi#236 from mowangdk/feature/bump_csi-driver-host-path_version
b01fd53 Bump csi-driver-host-path version up to v1.12.0
984feec Merge pull request kubernetes-csi#234 from siddhikhapare/csi-tools
1f7e605 fixed broken links of testgrid dashboard
de2fba8 Merge pull request kubernetes-csi#233 from andyzhangx/andyzhangx-patch-1
cee895e remove windows 20H2 build since it's EOL long time ago
670bb0e Merge pull request kubernetes-csi#229 from marosset/fix-codespell-errors
35d5e78 Merge pull request kubernetes-csi#219 from yashsingh74/update-registry
63473cc Merge pull request kubernetes-csi#231 from coulof/bump-go-version-1.20.5
29a5c76 Merge pull request kubernetes-csi#228 from mowangdk/chore/adopt_kubernetes_recommand_labels
8dd2821 Update cloudbuild image with go 1.20.5
1df23db Merge pull request kubernetes-csi#230 from msau42/prow
1f92b7e Add ginkgo timeout to e2e tests to help catch any stuck tests
2b8b80e fixing some codespell errors
c10b678 Merge pull request kubernetes-csi#227 from coulof/check-sidecar-supported-versions
72984ec chore: adopt kubernetes recommand label
b055535 Header
bd0a10b typo
c39d73c Add comments
f6491af Script to verify EOL sidecar version
4133d1d Merge pull request kubernetes-csi#226 from msau42/cloudbuild
8d519d2 Pin buildkit to v0.10.6 to workaround v0.11 bug with docker manifest
6e04a03 Merge pull request kubernetes-csi#224 from msau42/cloudbuild
26fdfff Update cloudbuild image
6613c39 Merge pull request kubernetes-csi#223 from sunnylovestiramisu/update
0e7ae99 Update k8s image repo url
77e47cc Merge pull request kubernetes-csi#222 from xinydev/fix-dep-version
155854b Fix dep version mismatch
8f83905 Merge pull request kubernetes-csi#221 from sunnylovestiramisu/go-update
1d3f94d Update go version to 1.20 to match k/k v1.27
e322ce5 Merge pull request kubernetes-csi#220 from andyzhangx/fix-golint-error
b74a512 test: fix golint error
901bcb5 Update registry k8s.gcr.io -> registry.k8s.io

git-subtree-dir: release-tools
git-subtree-split: 734c2b950c4b31f64b63052c64ffa5929d1c9b97
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants