Skip to content

Commit

Permalink
fix: modifying the tests to be aware of time created to properly simu…
Browse files Browse the repository at this point in the history
…late vm gc
  • Loading branch information
Bryce-Soghigian committed Jan 28, 2025
1 parent 3d0b0b9 commit c0e4043
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controllers/nodeclaim/garbagecollection/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@ var _ = Describe("NetworkInterface Garbage Collection", func() {
managedVM := test.VirtualMachine(test.VirtualMachineOptions{
Name: lo.FromPtr(managedNic.Name),
Tags: test.ManagedTags(nodePool.Name),
Properties: &armcompute.VirtualMachineProperties{
TimeCreated: lo.ToPtr(time.Now().Add(-time.Minute * 16)), // Needs to be older than the nodeclaim registration ttl
},
})
azureEnv.VirtualMachinesAPI.VirtualMachinesBehavior.Instances.Store(lo.FromPtr(managedVM.ID), *managedVM)
ExpectSingletonReconciled(ctx, networkInterfaceGCController)
Expand Down

0 comments on commit c0e4043

Please sign in to comment.