Merge pull request #118623 from pohly/e2e-storage-stress-test-fix

e2e storage: terminate worker quietly on test completion
This commit is contained in:
Kubernetes Prow Robot 2023-06-12 13:47:05 -07:00 committed by GitHub
commit 07646db483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@ package storage
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"math/rand" "math/rand"
"path/filepath" "path/filepath"
@ -517,7 +518,7 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
continue continue
} }
pv, err = config.client.CoreV1().PersistentVolumes().Get(backgroundCtx, pv.Name, metav1.GetOptions{}) pv, err = config.client.CoreV1().PersistentVolumes().Get(backgroundCtx, pv.Name, metav1.GetOptions{})
if apierrors.IsNotFound(err) { if apierrors.IsNotFound(err) || errors.Is(err, context.Canceled) {
continue continue
} }
// Delete and create a new PV for same local volume storage // Delete and create a new PV for same local volume storage
@ -528,9 +529,15 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
continue continue
} }
err = config.client.CoreV1().PersistentVolumes().Delete(backgroundCtx, pv.Name, metav1.DeleteOptions{}) err = config.client.CoreV1().PersistentVolumes().Delete(backgroundCtx, pv.Name, metav1.DeleteOptions{})
if errors.Is(err, context.Canceled) {
continue
}
framework.ExpectNoError(err) framework.ExpectNoError(err)
pvConfig := makeLocalPVConfig(config, localVolume) pvConfig := makeLocalPVConfig(config, localVolume)
localVolume.pv, err = e2epv.CreatePV(backgroundCtx, config.client, f.Timeouts, e2epv.MakePersistentVolume(pvConfig)) localVolume.pv, err = e2epv.CreatePV(backgroundCtx, config.client, f.Timeouts, e2epv.MakePersistentVolume(pvConfig))
if errors.Is(err, context.Canceled) {
continue
}
framework.ExpectNoError(err) framework.ExpectNoError(err)
} }
} }