Skip to content
Snippets Groups Projects
Commit e2e1b609 authored by Theo Barber-Bany's avatar Theo Barber-Bany
Browse files

Updates MachineSet tests to use GenerateName

Use GenerateName when creating MachineSet instances to avoid test
flakes.

Turs out the DeleteAll call in the cleanup function is async, so
occasionally we were seeing test failures where the instance name was being
reused, but the previous instance had not deleted yet.
parent 47ee7416
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ var _ = Describe("MachineSet Reconciler", func() { ...@@ -91,7 +91,7 @@ var _ = Describe("MachineSet Reconciler", func() {
By("Setting up the machine set builder") By("Setting up the machine set builder")
machineSetBuilder = machinev1resourcebuilder.MachineSet(). machineSetBuilder = machinev1resourcebuilder.MachineSet().
WithNamespace(namespace.ObjectMeta.Name). WithNamespace(namespace.ObjectMeta.Name).
WithName("foo"). WithGenerateName("foo").
WithReplicas(replicas). WithReplicas(replicas).
WithLabels(map[string]string{"foo": "bar"}) WithLabels(map[string]string{"foo": "bar"})
...@@ -151,7 +151,7 @@ var _ = Describe("MachineSet Reconciler", func() { ...@@ -151,7 +151,7 @@ var _ = Describe("MachineSet Reconciler", func() {
It("Should set the Paused condition appropriately", func() { It("Should set the Paused condition appropriately", func() {
instance := machineSetBuilder. instance := machineSetBuilder.
WithName("baz"). WithGenerateName("baz").
WithLabels(map[string]string{"baz": "bar"}). WithLabels(map[string]string{"baz": "bar"}).
Build() Build()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment