Skip to content

Commit 8259fca

Browse files
committed
test fixes
1 parent 3564dd0 commit 8259fca

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

internal/controllers/machine/machine_controller_test.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -1653,9 +1653,10 @@ func TestDrainNode(t *testing.T) {
16531653

16541654
tracker := remote.NewTestClusterCacheTracker(ctrl.Log, c, remoteClient, fakeScheme, client.ObjectKeyFromObject(testCluster))
16551655
r := &Reconciler{
1656-
Client: c,
1657-
Tracker: tracker,
1658-
drainCache: drain.NewCache(),
1656+
Client: c,
1657+
Tracker: tracker,
1658+
drainCache: drain.NewCache(),
1659+
waitForVolumeDetachCache: drain.NewCache(),
16591660
}
16601661

16611662
res, err := r.drainNode(ctx, testCluster, testMachine, tt.nodeName)
@@ -1752,10 +1753,12 @@ func TestDrainNode_withCaching(t *testing.T) {
17521753

17531754
tracker := remote.NewTestClusterCacheTracker(ctrl.Log, c, remoteClient, fakeScheme, client.ObjectKeyFromObject(testCluster))
17541755
drainCache := drain.NewCache()
1756+
waitForVolumeDetachCache := drain.NewCache()
17551757
r := &Reconciler{
1756-
Client: c,
1757-
Tracker: tracker,
1758-
drainCache: drainCache,
1758+
Client: c,
1759+
Tracker: tracker,
1760+
drainCache: drainCache,
1761+
waitForVolumeDetachCache: waitForVolumeDetachCache,
17591762
}
17601763

17611764
// The first reconcile will cordon the Node, evict the one Pod running on the Node and then requeue.
@@ -3049,6 +3052,7 @@ func TestNodeDeletion(t *testing.T) {
30493052
Tracker: tracker,
30503053
recorder: record.NewFakeRecorder(10),
30513054
nodeDeletionRetryTimeout: 10 * time.Millisecond,
3055+
waitForVolumeDetachCache: drain.NewCache(),
30523056
}
30533057

30543058
cluster := testCluster.DeepCopy()
@@ -3173,6 +3177,7 @@ func TestNodeDeletionWithoutNodeRefFallback(t *testing.T) {
31733177
Tracker: tracker,
31743178
recorder: record.NewFakeRecorder(10),
31753179
nodeDeletionRetryTimeout: 10 * time.Millisecond,
3180+
waitForVolumeDetachCache: drain.NewCache(),
31763181
}
31773182

31783183
cluster := testCluster.DeepCopy()

0 commit comments

Comments
 (0)