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

feat(e2e): refactor hard-coded provision size #78306

Merged
merged 2 commits into from
Oct 9, 2019

Conversation

hoyho
Copy link
Contributor

@hoyho hoyho commented May 24, 2019

test/e2e/storage/testsuites creates volumes dynamically. Initially, the size of those volumes was
hard-coded in the test, which prevented using the tests with storage backends that couldn't support
that hard-coded size

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test

/kind feature

/kind flake

What this PR does / why we need it:
some e2e test will fail due to the hard coding volume size 5Gi and some
diver not support.

previously, there's a discussion and PR to solve this. But after half year,
we need to redo it base on PR because some code have changed and not easy to rebase or test

see #72080

Which issue(s) this PR fixes:

Fixes #72080

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@k8s-ci-robot
Copy link
Contributor

Welcome @hoyho!

It looks like this is your first PR to kubernetes/kubernetes 🎉. 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/kubernetes 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
Copy link
Contributor

@hoyho: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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 kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 24, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @hoyho. Thanks for your PR.

I'm waiting for a 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 area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 24, 2019
@neolit123
Copy link
Member

/sig storage

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label May 27, 2019
@neolit123
Copy link
Member

Merge branch 'master' into feat/e2e-storage-dynamic-size

there shouldn't be such merge commits. please squash the change into one commit.
also, if you want reviewers to take a look at this try pinging #sig-storage on slack.

@neolit123
Copy link
Member

/release-note-none

@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 May 27, 2019
@hoyho hoyho force-pushed the feat/e2e-storage-dynamic-size branch from 55d845c to 3bc62cb Compare May 28, 2019 03:36
@jsafrane
Copy link
Member

/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 May 28, 2019
@rootfs
Copy link
Contributor

rootfs commented May 29, 2019

/assign @jsafrane

@k8s-ci-robot k8s-ci-robot removed sig/testing Categorizes an issue or PR as relevant to SIG Testing. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 29, 2019
@hoyho
Copy link
Contributor Author

hoyho commented Sep 30, 2019

ping @hoyho any updates?
/remove-area e2e-test-framework
/remove-sig testing
/priority important-soon
/milestone v1.17

WIP

@hoyho hoyho force-pushed the feat/e2e-storage-dynamic-size branch from 075da07 to ef57183 Compare October 2, 2019 08:09
@k8s-ci-robot k8s-ci-robot added area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Oct 2, 2019
@hoyho hoyho force-pushed the feat/e2e-storage-dynamic-size branch from ef57183 to 37e56a8 Compare October 2, 2019 14:18
@hoyho
Copy link
Contributor Author

hoyho commented Oct 2, 2019

/test pull-kubernetes-e2e-gce-storage-slow

@hoyho hoyho force-pushed the feat/e2e-storage-dynamic-size branch from 37e56a8 to 0017048 Compare October 4, 2019 16:08
@msau42
Copy link
Member

msau42 commented Oct 4, 2019

/retest

@hoyho
Copy link
Contributor Author

hoyho commented Oct 5, 2019

/test pull-kubernetes-e2e-gce-100-performance
/test pull-kubernetes-kubemark-e2e-gce-big
/test pull-kubernetes-conformance-kind-ipv6

@hoyho hoyho requested review from pohly, oomichi and msau42 October 5, 2019 12:30
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.

Don't we have some test which actually writes quite a bit of data? volume IO or something? That test then may need a larger minimum volume size.

I can't think of a reason why a test should have a maximum volume size.

@@ -80,6 +81,9 @@ func initHostPathCSIDriver(name string, capabilities map[testsuites.Capability]b
SupportedFsType: sets.NewString(
"", // Default fsType
),
SupportedSizeRange: volume.SizeRange{
Min: "5Gi",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed. The hostpath driver is one of those drivers where we can be sure that it has no minimum size.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be removed. The hostpath driver is one of those drivers where we can be sure that it has no minimum size.

I am afraid the hostpath driver should have a minimum size 1Mb?
From source code here https://github.com/kubernetes-csi/csi-driver-host-path/blob/3488dc7f994e33485629b86b69a6f34ebb7ef2d9/pkg/hostpath/hostpath.go#L181 If the volume access type is 'block', then the driver will call fallocate with size unit M .
Too small size will be invalid.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, I was thinking of filesystem mode. For block mode I am not sure whether the driver should round up internally - this sounds like a bug in the driver.

Anyway, let's then keep the minimum size.

// provisioned volumes. Default is "5GiB".
ClaimSize string
// provisioned volumes.
SupportedSizeRange volume.SizeRange
Copy link
Contributor

Choose a reason for hiding this comment

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

ClaimSize must be replaced with SupportedSizeRange to match the field name.

@@ -181,7 +186,7 @@ type genericVolumeTestResource struct {

var _ TestResource = &genericVolumeTestResource{}

func createGenericVolumeTestResource(driver TestDriver, config *PerTestConfig, pattern testpatterns.TestPattern) *genericVolumeTestResource {
func createGenericVolumeTestResource(driver TestDriver, config *PerTestConfig, pattern testpatterns.TestPattern, tsSupportedSizeRange volume.SizeRange) *genericVolumeTestResource {
Copy link
Contributor

Choose a reason for hiding this comment

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

The ts prefix is non-obvious here. What does it stand for? "Test"?

What about testVolumeSizeRange as variable name?

@@ -214,7 +219,11 @@ func createGenericVolumeTestResource(driver TestDriver, config *PerTestConfig, p
case testpatterns.DynamicPV:
framework.Logf("Creating resource for dynamic PV")
if dDriver, ok := driver.(DynamicPVTestDriver); ok {
claimSize := dDriver.GetClaimSize()
var err error
dSupportedSizeRange := dDriver.GetDriverInfo().SupportedSizeRange
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here - does "d" stand for "driver" or "dynamic"? Better spell it out.

For consistency with the proposed "testVolumeSizeRange", how about "driverVolumeSizeRange"?

@@ -49,6 +50,10 @@ func InitMultiVolumeTestSuite() TestSuite {
testpatterns.BlockVolModePreprovisionedPV,
testpatterns.BlockVolModeDynamicPV,
},
supportedSizeRange: volume.SizeRange{
Min: "1Mi",
Max: "10Gi",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does the test have a max size? I don't think it needs one.

@@ -65,6 +65,10 @@ func InitSubPathTestSuite() TestSuite {
testpatterns.DefaultFsDynamicPV,
testpatterns.NtfsDynamicPV,
},
supportedSizeRange: volume.SizeRange{
Min: "1Mi",
Max: "10Gi",
Copy link
Contributor

Choose a reason for hiding this comment

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

And here.

@@ -57,6 +58,10 @@ func InitVolumeExpandTestSuite() TestSuite {
testpatterns.DefaultFsDynamicPVAllowExpansion,
testpatterns.BlockVolModeDynamicPVAllowExpansion,
},
supportedSizeRange: volume.SizeRange{
Min: "1Mi",
Max: "10Gi",
Copy link
Contributor

Choose a reason for hiding this comment

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

And here.

@@ -68,6 +68,10 @@ func InitVolumeIOTestSuite() TestSuite {
testpatterns.DefaultFsPreprovisionedPV,
testpatterns.DefaultFsDynamicPV,
},
supportedSizeRange: volume.SizeRange{
Min: "1Mi",
Max: "10Gi",
Copy link
Contributor

Choose a reason for hiding this comment

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

And here.

@@ -60,6 +61,10 @@ func InitVolumeModeTestSuite() TestSuite {
testpatterns.BlockVolModePreprovisionedPV,
testpatterns.BlockVolModeDynamicPV,
},
supportedSizeRange: volume.SizeRange{
Min: "1Mi",
Max: "10Gi",
Copy link
Contributor

Choose a reason for hiding this comment

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

And here.

@@ -71,6 +71,10 @@ func InitVolumesTestSuite() TestSuite {
testpatterns.BlockVolModePreprovisionedPV,
testpatterns.BlockVolModeDynamicPV,
},
supportedSizeRange: volume.SizeRange{
Min: "1Mi",
Max: "10Gi",
Copy link
Contributor

Choose a reason for hiding this comment

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

And here.

test/e2e/storage/testsuites creates volumes dynamically. Initially, the size of those volumes was
hard-coded in the test, which prevented using the tests with storage backends that couldn't support
that hard-coded size
@hoyho hoyho force-pushed the feat/e2e-storage-dynamic-size branch from 0017048 to b5c1432 Compare October 7, 2019 17:34
@hoyho
Copy link
Contributor Author

hoyho commented Oct 8, 2019

/test pull-kubernetes-kubemark-e2e-gce-big
/test pull-kubernetes-e2e-gce-100-performance
/test pull-kubernetes-e2e-kind

@pohly
Copy link
Contributor

pohly commented Oct 8, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2019
@msau42
Copy link
Member

msau42 commented Oct 8, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hoyho, msau42

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 Oct 8, 2019
@k8s-ci-robot k8s-ci-robot merged commit 05474a6 into kubernetes:master Oct 9, 2019
ohsewon pushed a commit to ohsewon/kubernetes that referenced this pull request Oct 16, 2019
…ic-size

feat(e2e): refactor hard-coded provision size
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/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

E2E storage: dynamically determine test volume size
10 participants