From 734c36851fb94d27cb021b392702cad512a039f4 Mon Sep 17 00:00:00 2001 From: geyingqi Date: Sat, 26 Oct 2024 12:34:12 +0800 Subject: [PATCH] test:Add podgcCtrl to attachdetachClients --- test/integration/volume/attach_detach_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/integration/volume/attach_detach_test.go b/test/integration/volume/attach_detach_test.go index 4f5c3340558..ce89ea36bd7 100644 --- a/test/integration/volume/attach_detach_test.go +++ b/test/integration/volume/attach_detach_test.go @@ -158,7 +158,7 @@ func TestPodDeletionWithDswp(t *testing.T) { tCtx := ktesting.Init(t) defer tCtx.Cancel("test has completed") - testClient, ctrl, pvCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig) + testClient, ctrl, pvCtrl, podgcCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig) ns := framework.CreateNamespaceOrDie(testClient, namespaceName, t) defer framework.DeleteNamespaceOrDie(testClient, ns, t) @@ -185,6 +185,7 @@ func TestPodDeletionWithDswp(t *testing.T) { go ctrl.Run(tCtx) // Run pvCtrl to avoid leaking goroutines started during its creation. go pvCtrl.Run(tCtx) + go podgcCtrl.Run(tCtx) waitToObservePods(t, podInformer, 1) podKey, err := cache.MetaNamespaceKeyFunc(pod) @@ -232,7 +233,7 @@ func TestPodUpdateWithWithADC(t *testing.T) { tCtx := ktesting.Init(t) defer tCtx.Cancel("test has completed") - testClient, ctrl, pvCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig) + testClient, ctrl, pvCtrl, podgcCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig) ns := framework.CreateNamespaceOrDie(testClient, namespaceName, t) defer framework.DeleteNamespaceOrDie(testClient, ns, t) @@ -262,6 +263,7 @@ func TestPodUpdateWithWithADC(t *testing.T) { go ctrl.Run(tCtx) // Run pvCtrl to avoid leaking goroutines started during its creation. go pvCtrl.Run(tCtx) + go podgcCtrl.Run(tCtx) waitToObservePods(t, podInformer, 1) podKey, err := cache.MetaNamespaceKeyFunc(pod) @@ -420,7 +422,7 @@ func TestPodAddedByDswp(t *testing.T) { tCtx := ktesting.Init(t) defer tCtx.Cancel("test has completed") - testClient, ctrl, pvCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig) + testClient, ctrl, pvCtrl, podgcCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig) ns := framework.CreateNamespaceOrDie(testClient, namespaceName, t) defer framework.DeleteNamespaceOrDie(testClient, ns, t) @@ -449,6 +451,7 @@ func TestPodAddedByDswp(t *testing.T) { go ctrl.Run(tCtx) // Run pvCtrl to avoid leaking goroutines started during its creation. go pvCtrl.Run(tCtx) + go podgcCtrl.Run(tCtx) waitToObservePods(t, podInformer, 1) podKey, err := cache.MetaNamespaceKeyFunc(pod) @@ -490,7 +493,7 @@ func TestPVCBoundWithADC(t *testing.T) { namespaceName := "test-pod-deletion" - testClient, ctrl, pvCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, attachdetach.TimerConfig{ + testClient, ctrl, pvCtrl, podgcCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, attachdetach.TimerConfig{ ReconcilerLoopPeriod: 100 * time.Millisecond, ReconcilerMaxWaitForUnmountDuration: 6 * time.Second, DesiredStateOfWorldPopulatorLoopSleepPeriod: 24 * time.Hour, @@ -538,6 +541,7 @@ func TestPVCBoundWithADC(t *testing.T) { initCSIObjects(tCtx.Done(), informers) go ctrl.Run(tCtx) go pvCtrl.Run(tCtx) + go podgcCtrl.Run(tCtx) waitToObservePods(t, informers.Core().V1().Pods().Informer(), 4) // Give attachdetach controller enough time to populate pods into DSWP.