Skip to content

Commit 1ae53a1

Browse files
committed
Limiting the scope of new kubectl get e2e tests to decrease flakiness
The `kubectl get output` e2e test I'd previously added ended up being flaky in certain e2e test scenarios. It relies on getting a list of API resources in the cluster and running `kubectl get` calls against them. The problem ended up being that other e2e tests could create resources that would cause this test to fail. This change limits the scope of the tests to not cover CRDs. This should still allow the test to catch new Kubernetes resources with improperly configured kubectl output while limiting the flakiness of the test.
1 parent f7c3fa8 commit 1ae53a1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/e2e/kubectl/kubectl.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,9 @@ var _ = SIGDescribe("Kubectl client", func() {
438438
"BackendConfig": true,
439439
"NodeMetrics": true,
440440
"PodMetrics": true,
441-
"ScalingPolicy": true,
442441
"VolumeSnapshotClass": true,
443442
"VolumeSnapshotContent": true,
444443
"VolumeSnapshot": true,
445-
446-
// A CRD created by other e2e tests without any test data.
447-
"Noxu": true,
448444
}
449445

450446
apiGroups, err := c.Discovery().ServerPreferredResources()
@@ -453,6 +449,13 @@ var _ = SIGDescribe("Kubectl client", func() {
453449
testableResources := etcd.GetEtcdStorageDataForNamespace(f.Namespace.Name)
454450

455451
for _, group := range apiGroups {
452+
// This limits the scope of this test to exclude CRDs. This
453+
// assumes that CRDs will not have a .k8s.io group and will have
454+
// a . in their name.
455+
if !strings.Contains(group.GroupVersion, ".k8s.io") && strings.Contains(group.GroupVersion, ".") {
456+
continue
457+
}
458+
456459
for _, resource := range group.APIResources {
457460
if !verbsContain(resource.Verbs, "get") || ignoredResources[resource.Kind] || strings.HasPrefix(resource.Name, "e2e-test") {
458461
continue

0 commit comments

Comments
 (0)