mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Merge pull request #118524 from onsi/fix-115945
Fix flaky persistent volumes e2e test
This commit is contained in:
commit
c4f44b3de3
@ -463,6 +463,8 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
|
|||||||
|
|
||||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||||
setupStorageClass(ctx, config, &waitMode)
|
setupStorageClass(ctx, config, &waitMode)
|
||||||
|
ginkgo.DeferCleanup(cleanupStorageClass, config)
|
||||||
|
|
||||||
for i, node := range config.nodes {
|
for i, node := range config.nodes {
|
||||||
ginkgo.By(fmt.Sprintf("Setting up %d local volumes on node %q", volsPerNode, node.Name))
|
ginkgo.By(fmt.Sprintf("Setting up %d local volumes on node %q", volsPerNode, node.Name))
|
||||||
allLocalVolumes[node.Name] = setupLocalVolumes(ctx, config, volType, &config.nodes[i], volsPerNode)
|
allLocalVolumes[node.Name] = setupLocalVolumes(ctx, config, volType, &config.nodes[i], volsPerNode)
|
||||||
@ -476,6 +478,13 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
|
|||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ginkgo.DeferCleanup(func(ctx context.Context) {
|
||||||
|
ginkgo.By("Clean all PVs")
|
||||||
|
for nodeName, localVolumes := range allLocalVolumes {
|
||||||
|
ginkgo.By(fmt.Sprintf("Cleaning up %d local volumes on node %q", len(localVolumes), nodeName))
|
||||||
|
cleanupLocalVolumes(ctx, config, localVolumes)
|
||||||
|
}
|
||||||
|
})
|
||||||
ginkgo.By("Start a goroutine to recycle unbound PVs")
|
ginkgo.By("Start a goroutine to recycle unbound PVs")
|
||||||
backgroundCtx, cancel := context.WithCancel(context.Background())
|
backgroundCtx, cancel := context.WithCancel(context.Background())
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
@ -532,15 +541,6 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
|
|||||||
}()
|
}()
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.AfterEach(func(ctx context.Context) {
|
|
||||||
ginkgo.By("Clean all PVs")
|
|
||||||
for nodeName, localVolumes := range allLocalVolumes {
|
|
||||||
ginkgo.By(fmt.Sprintf("Cleaning up %d local volumes on node %q", len(localVolumes), nodeName))
|
|
||||||
cleanupLocalVolumes(ctx, config, localVolumes)
|
|
||||||
}
|
|
||||||
cleanupStorageClass(ctx, config)
|
|
||||||
})
|
|
||||||
|
|
||||||
ginkgo.It("should be able to process many pods and reuse local volumes", func(ctx context.Context) {
|
ginkgo.It("should be able to process many pods and reuse local volumes", func(ctx context.Context) {
|
||||||
var (
|
var (
|
||||||
podsLock sync.Mutex
|
podsLock sync.Mutex
|
||||||
|
Loading…
Reference in New Issue
Block a user