mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Parallelize RC deletion in density test
This commit is contained in:
parent
0e31372b2f
commit
c07ecad613
@ -357,14 +357,23 @@ func cleanupDensityTest(dtc DensityTestConfig, testPhaseDurations *timer.TestPha
|
|||||||
By("Deleting created Collections")
|
By("Deleting created Collections")
|
||||||
numberOfClients := len(dtc.ClientSets)
|
numberOfClients := len(dtc.ClientSets)
|
||||||
// We explicitly delete all pods to have API calls necessary for deletion accounted in metrics.
|
// We explicitly delete all pods to have API calls necessary for deletion accounted in metrics.
|
||||||
|
wg := sync.WaitGroup{}
|
||||||
|
wg.Add(len(dtc.Configs))
|
||||||
for i := range dtc.Configs {
|
for i := range dtc.Configs {
|
||||||
name := dtc.Configs[i].GetName()
|
name := dtc.Configs[i].GetName()
|
||||||
namespace := dtc.Configs[i].GetNamespace()
|
namespace := dtc.Configs[i].GetNamespace()
|
||||||
kind := dtc.Configs[i].GetKind()
|
kind := dtc.Configs[i].GetKind()
|
||||||
By(fmt.Sprintf("Cleaning up only the %v, garbage collector will clean up the pods", kind))
|
client := dtc.ClientSets[i%numberOfClients]
|
||||||
err := framework.DeleteResourceAndWaitForGC(dtc.ClientSets[i%numberOfClients], kind, namespace, name)
|
go func() {
|
||||||
|
defer GinkgoRecover()
|
||||||
|
// Call wg.Done() in defer to avoid blocking whole test
|
||||||
|
// in case of error from RunRC.
|
||||||
|
defer wg.Done()
|
||||||
|
err := framework.DeleteResourceAndWaitForGC(client, kind, namespace, name)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
wg.Wait()
|
||||||
podCleanupPhase.End()
|
podCleanupPhase.End()
|
||||||
|
|
||||||
dtc.deleteSecrets(testPhaseDurations.StartPhase(910, "secrets deletion"))
|
dtc.deleteSecrets(testPhaseDurations.StartPhase(910, "secrets deletion"))
|
||||||
|
Loading…
Reference in New Issue
Block a user