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 nil pointer in test AfterEach for volumeperf.go #117368

Merged
merged 1 commit into from Apr 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 17 additions & 10 deletions test/e2e/storage/testsuites/volumeperf.go
Expand Up @@ -129,18 +129,25 @@ func (t *volumePerformanceTestSuite) DefineTests(driver storageframework.TestDri
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelPrivileged

ginkgo.AfterEach(func(ctx context.Context) {
ginkgo.By("Closing informer channel")
close(l.stopCh)
ginkgo.By("Deleting all PVCs")
for _, pvc := range l.pvcs {
err := e2epv.DeletePersistentVolumeClaim(ctx, l.cs, pvc.Name, pvc.Namespace)
framework.ExpectNoError(err)
err = e2epv.WaitForPersistentVolumeDeleted(ctx, l.cs, pvc.Spec.VolumeName, 1*time.Second, 5*time.Minute)
if l != nil {
if l.stopCh != nil {
ginkgo.By("Closing informer channel")
close(l.stopCh)
}

ginkgo.By("Deleting all PVCs")
for _, pvc := range l.pvcs {
err := e2epv.DeletePersistentVolumeClaim(ctx, l.cs, pvc.Name, pvc.Namespace)
framework.ExpectNoError(err)
err = e2epv.WaitForPersistentVolumeDeleted(ctx, l.cs, pvc.Spec.VolumeName, 1*time.Second, 5*time.Minute)
framework.ExpectNoError(err)
}
ginkgo.By(fmt.Sprintf("Deleting Storage Class %s", l.scName))
err := l.cs.StorageV1().StorageClasses().Delete(ctx, l.scName, metav1.DeleteOptions{})
framework.ExpectNoError(err)
} else {
ginkgo.By("Local l setup is nil")
}
ginkgo.By(fmt.Sprintf("Deleting Storage Class %s", l.scName))
err := l.cs.StorageV1().StorageClasses().Delete(ctx, l.scName, metav1.DeleteOptions{})
framework.ExpectNoError(err)
})

ginkgo.It("should provision volumes at scale within performance constraints [Slow] [Serial]", func(ctx context.Context) {
Expand Down