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
Make external driver name generation contain a more random suffix in case of double generation in the same framework context (twice in the same test) #77525
Conversation
fe8dafc
to
55b3282
Compare
Ran the multivolume tests with this fix with the external GCE PD CSI Driver and confirmed this fixes the issue |
/lgtm |
/retest Review the full test history for this PR. Silence the bot with an |
/lgtm cancel |
Regarding the actual change: the name space is already random. Can you explain in a bit more detail (ideally in the commit message) what problem you are trying to solve? It's not clear to me from the given information, and it looks like the fix isn't right either because other tests are now failing (or was that due to something unrelated?). |
Thats fair; however, patch items means absolutely nothing and was one of the reasons why it took me longer than it should have to debug this issue. Unless you are already an expert in this code its almost impossible to know what it's doing and how to find the place where the name is being generated. Also lets not design things for a potential future use case that we haven't thought of or needed. This name describes what the function currently does and it is not costly to be renamed if it needs to be refactored/rewritten later.
The |
55b3282
to
014fb31
Compare
/retest |
David Zhu <notifications@github.com> writes:
This name describes what the function
currently does and it is not costly to be renamed if it needs to be
refactored/rewritten later.
Changing the public API of the E2E framework is costly. Everyone using
it has to make the same change. If you feel strongly about this, then
please submit a separate cleanup PR.
> Regarding the actual change: the name space is already random. Can you explain in a bit more detail (ideally in the commit message) what problem you are trying to solve? It's not clear to me from the given information, and it looks like the fix isn't right either because other tests are now failing (or was that due to something unrelated?).
The `multiVolume` tests run `createGenericTestResource` twice, thus
creating two storage classes in the same test framework. The namespace
name is stable in the context of a test so the two storage classes are
created with the same name and the tests fail. As for unrelated
failing tests, I'm looking into them now but on first glance it looks
like the CSI tests were inferring generated names for cluster role
yamls and not using the actual generated names.
It sounds a bit like it might better to handle this special case in the
multiVolume test by explicitly renaming the storage classes, and just
the storage classes. Anyway, I'll let you investigate this further.
|
/priority important-soon |
I would argue that changing the function name when functionality changes forces you to think about whether this functionality change works for all function callers. If we are exporting this function as a public API, shouldn't the returned result (the modified object since this modifies objects in-place) be stable as well? If you are thinking about other callers using this function doesn't keeping an ambiguous function name
Done |
Are we officially supporting the Kubernetes e2e test framework as a publicly consumable library outside of kubernetes/kubernetes? |
Michelle Au <notifications@github.com> writes:
Are we officially supporting the Kubernetes e2e test framework as a
publicly consumable library outside of kubernetes/kubernetes?
Yes, it is consumable externally. But as it is part of k/k, there's no
API stability guarantee. I'm just pointing out that changing the APIs is
not quite as cheap as it was said to be.
What I do object against is making an API change together with a
functional change in a single PR. These are two different changes and
should be discussed separately.
|
…dom suffix in case of double generation in the same framework context (twice in the same test)
014fb31
to
c50e7fd
Compare
@pohly removed the function name change |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidz627, 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 |
/lgtm |
/test pull-kubernetes-e2e-gce-storage-slow |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
@davidz627: 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/test-infra repository. I understand the commands that are listed here. |
func (f *Framework) PatchName(item *string) { | ||
// uniquifyName makes the name of some item unique per namespace by appending the | ||
// generated unique name of the test namespace. | ||
func (f *Framework) uniquifyName(item *string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still an API change. When this create.go was initially merged, I was explicitly asked to split it up so that someone can load items, patch them (either with the existing PatchItems
or some custom code), and then create them.
Such custom code is meant to have access to individual building blocks like this PatchName
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to submit a PR changing these back to external
case *storage.StorageClass: | ||
f.PatchName(&item.Name) | ||
f.randomizeStorageClassName(&item.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now storage classes are "more unique" than other items and regardless what we call the function which does this, I'm worried that this will be confusing.
Where is this failing test code that must load storage classes twice into the same namespace?
// all items can be namespaced. For those, the name also needs to be | ||
// patched. | ||
func (f *Framework) PatchNamespace(item *string) { | ||
func (f *Framework) patchNamespace(item *string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same API change here.
/retest Review the full test history for this PR. Silence the bot with an |
Hrmm, I hadn't realized that this had both lgtm and approval. I don't think this should have been merged. |
Fixes multivolume tests for external drivers.
/kind bug
/kind failing-test
/sig storage
/assign @msau42 @pohly
/cc @mkimuram