Skip to content

Commit 734c368

Browse files
committed
test:Add podgcCtrl to attachdetachClients
1 parent 6910e76 commit 734c368

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/integration/volume/attach_detach_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func TestPodDeletionWithDswp(t *testing.T) {
158158

159159
tCtx := ktesting.Init(t)
160160
defer tCtx.Cancel("test has completed")
161-
testClient, ctrl, pvCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig)
161+
testClient, ctrl, pvCtrl, podgcCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig)
162162

163163
ns := framework.CreateNamespaceOrDie(testClient, namespaceName, t)
164164
defer framework.DeleteNamespaceOrDie(testClient, ns, t)
@@ -185,6 +185,7 @@ func TestPodDeletionWithDswp(t *testing.T) {
185185
go ctrl.Run(tCtx)
186186
// Run pvCtrl to avoid leaking goroutines started during its creation.
187187
go pvCtrl.Run(tCtx)
188+
go podgcCtrl.Run(tCtx)
188189

189190
waitToObservePods(t, podInformer, 1)
190191
podKey, err := cache.MetaNamespaceKeyFunc(pod)
@@ -232,7 +233,7 @@ func TestPodUpdateWithWithADC(t *testing.T) {
232233

233234
tCtx := ktesting.Init(t)
234235
defer tCtx.Cancel("test has completed")
235-
testClient, ctrl, pvCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig)
236+
testClient, ctrl, pvCtrl, podgcCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig)
236237

237238
ns := framework.CreateNamespaceOrDie(testClient, namespaceName, t)
238239
defer framework.DeleteNamespaceOrDie(testClient, ns, t)
@@ -262,6 +263,7 @@ func TestPodUpdateWithWithADC(t *testing.T) {
262263
go ctrl.Run(tCtx)
263264
// Run pvCtrl to avoid leaking goroutines started during its creation.
264265
go pvCtrl.Run(tCtx)
266+
go podgcCtrl.Run(tCtx)
265267

266268
waitToObservePods(t, podInformer, 1)
267269
podKey, err := cache.MetaNamespaceKeyFunc(pod)
@@ -420,7 +422,7 @@ func TestPodAddedByDswp(t *testing.T) {
420422

421423
tCtx := ktesting.Init(t)
422424
defer tCtx.Cancel("test has completed")
423-
testClient, ctrl, pvCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig)
425+
testClient, ctrl, pvCtrl, podgcCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, defaultTimerConfig)
424426

425427
ns := framework.CreateNamespaceOrDie(testClient, namespaceName, t)
426428
defer framework.DeleteNamespaceOrDie(testClient, ns, t)
@@ -449,6 +451,7 @@ func TestPodAddedByDswp(t *testing.T) {
449451
go ctrl.Run(tCtx)
450452
// Run pvCtrl to avoid leaking goroutines started during its creation.
451453
go pvCtrl.Run(tCtx)
454+
go podgcCtrl.Run(tCtx)
452455

453456
waitToObservePods(t, podInformer, 1)
454457
podKey, err := cache.MetaNamespaceKeyFunc(pod)
@@ -490,7 +493,7 @@ func TestPVCBoundWithADC(t *testing.T) {
490493

491494
namespaceName := "test-pod-deletion"
492495

493-
testClient, ctrl, pvCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, attachdetach.TimerConfig{
496+
testClient, ctrl, pvCtrl, podgcCtrl, informers := createAdClients(tCtx, t, server, defaultSyncPeriod, attachdetach.TimerConfig{
494497
ReconcilerLoopPeriod: 100 * time.Millisecond,
495498
ReconcilerMaxWaitForUnmountDuration: 6 * time.Second,
496499
DesiredStateOfWorldPopulatorLoopSleepPeriod: 24 * time.Hour,
@@ -538,6 +541,7 @@ func TestPVCBoundWithADC(t *testing.T) {
538541
initCSIObjects(tCtx.Done(), informers)
539542
go ctrl.Run(tCtx)
540543
go pvCtrl.Run(tCtx)
544+
go podgcCtrl.Run(tCtx)
541545

542546
waitToObservePods(t, informers.Core().V1().Pods().Informer(), 4)
543547
// Give attachdetach controller enough time to populate pods into DSWP.

0 commit comments

Comments
 (0)