Skip to content

Commit c4e9153

Browse files
committed
Skip machine scale test when bare metal lacks extra workers.
Treat bare-metal extra-worker data as a hard precondition so fixed-capacity clusters skip cleanly instead of timing out on impossible MachineSet scale-ups.
1 parent ff6f2ef commit c4e9153

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

test/extended/machines/scale.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,23 @@ var _ = g.Describe("[sig-cluster-lifecycle][Feature:Machines][Serial] Managed cl
220220
o.Expect(err).NotTo(o.HaveOccurred())
221221
dc, err = dynamic.NewForConfig(cfg)
222222
o.Expect(err).NotTo(o.HaveOccurred())
223+
configClient, err = configclient.NewForConfig(cfg)
224+
o.Expect(err).NotTo(o.HaveOccurred())
223225

224-
// For baremetal platforms, an extra worker must be previously
225-
// deployed to allow subsequent scaling operations
226+
infrastructure, err := configClient.ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{})
227+
o.Expect(err).NotTo(o.HaveOccurred())
228+
229+
// For baremetal platforms, this test needs pre-created extra worker
230+
// data so a spare BareMetalHost can be made available before scaling.
226231
helper = bmhelper.NewBaremetalTestHelper(dc)
227-
if helper.CanDeployExtraWorkers() {
232+
if infrastructure.Status.Platform == configv1.BareMetalPlatformType {
233+
if !helper.CanDeployExtraWorkers() {
234+
e2eskipper.Skipf("baremetal cluster has no extra worker definitions available for MachineSet scaling")
235+
}
236+
228237
helper.Setup()
229238
helper.DeployExtraWorker(0)
230239
}
231-
232-
configClient, err = configclient.NewForConfig(cfg)
233-
o.Expect(err).NotTo(o.HaveOccurred())
234240
operatorsNotProgressing = getOperatorsNotProgressing(configClient)
235241
})
236242

0 commit comments

Comments
 (0)