Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Oct 4, 2024
1 parent 3564dd0 commit 8259fca
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions internal/controllers/machine/machine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1653,9 +1653,10 @@ func TestDrainNode(t *testing.T) {

tracker := remote.NewTestClusterCacheTracker(ctrl.Log, c, remoteClient, fakeScheme, client.ObjectKeyFromObject(testCluster))
r := &Reconciler{
Client: c,
Tracker: tracker,
drainCache: drain.NewCache(),
Client: c,
Tracker: tracker,
drainCache: drain.NewCache(),
waitForVolumeDetachCache: drain.NewCache(),
}

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

tracker := remote.NewTestClusterCacheTracker(ctrl.Log, c, remoteClient, fakeScheme, client.ObjectKeyFromObject(testCluster))
drainCache := drain.NewCache()
waitForVolumeDetachCache := drain.NewCache()
r := &Reconciler{
Client: c,
Tracker: tracker,
drainCache: drainCache,
Client: c,
Tracker: tracker,
drainCache: drainCache,
waitForVolumeDetachCache: waitForVolumeDetachCache,
}

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

cluster := testCluster.DeepCopy()
Expand Down Expand Up @@ -3173,6 +3177,7 @@ func TestNodeDeletionWithoutNodeRefFallback(t *testing.T) {
Tracker: tracker,
recorder: record.NewFakeRecorder(10),
nodeDeletionRetryTimeout: 10 * time.Millisecond,
waitForVolumeDetachCache: drain.NewCache(),
}

cluster := testCluster.DeepCopy()
Expand Down

0 comments on commit 8259fca

Please sign in to comment.