@@ -1322,20 +1322,20 @@ func TestReconcileMachinePoolMachines(t *testing.T) {
1322
1322
g .Expect (err ).ToNot (HaveOccurred ())
1323
1323
1324
1324
cluster := builder .Cluster (ns .Name , clusterName ).Build ()
1325
- g .Expect (env .Create (ctx , cluster )).To (Succeed ())
1325
+ g .Expect (env .CreateAndWait (ctx , cluster )).To (Succeed ())
1326
1326
1327
1327
t .Run ("Should do nothing if machines already exist" , func (* testing.T ) {
1328
1328
machinePool := getMachinePool (2 , "machinepool-test-1" , clusterName , ns .Name )
1329
- g .Expect (env .Create (ctx , & machinePool )).To (Succeed ())
1329
+ g .Expect (env .CreateAndWait (ctx , & machinePool )).To (Succeed ())
1330
1330
1331
1331
infraMachines := getInfraMachines (2 , machinePool .Name , clusterName , ns .Name )
1332
1332
for i := range infraMachines {
1333
- g .Expect (env .Create (ctx , & infraMachines [i ])).To (Succeed ())
1333
+ g .Expect (env .CreateAndWait (ctx , & infraMachines [i ])).To (Succeed ())
1334
1334
}
1335
1335
1336
1336
machines := getMachines (2 , machinePool .Name , clusterName , ns .Name )
1337
1337
for i := range machines {
1338
- g .Expect (env .Create (ctx , & machines [i ])).To (Succeed ())
1338
+ g .Expect (env .CreateAndWait (ctx , & machines [i ])).To (Succeed ())
1339
1339
}
1340
1340
1341
1341
infraConfig := map [string ]interface {}{
@@ -1365,7 +1365,7 @@ func TestReconcileMachinePoolMachines(t *testing.T) {
1365
1365
"infrastructureMachineKind" : builder .GenericInfrastructureMachineKind ,
1366
1366
},
1367
1367
}
1368
- g .Expect (env .Create (ctx , & unstructured.Unstructured {Object : infraConfig })).To (Succeed ())
1368
+ g .Expect (env .CreateAndWait (ctx , & unstructured.Unstructured {Object : infraConfig })).To (Succeed ())
1369
1369
1370
1370
r := & MachinePoolReconciler {
1371
1371
Client : env ,
@@ -1394,11 +1394,11 @@ func TestReconcileMachinePoolMachines(t *testing.T) {
1394
1394
1395
1395
t .Run ("Should create two machines if two infra machines exist" , func (* testing.T ) {
1396
1396
machinePool := getMachinePool (2 , "machinepool-test-2" , clusterName , ns .Name )
1397
- g .Expect (env .Create (ctx , & machinePool )).To (Succeed ())
1397
+ g .Expect (env .CreateAndWait (ctx , & machinePool )).To (Succeed ())
1398
1398
1399
1399
infraMachines := getInfraMachines (2 , machinePool .Name , clusterName , ns .Name )
1400
1400
for i := range infraMachines {
1401
- g .Expect (env .Create (ctx , & infraMachines [i ])).To (Succeed ())
1401
+ g .Expect (env .CreateAndWait (ctx , & infraMachines [i ])).To (Succeed ())
1402
1402
}
1403
1403
1404
1404
infraConfig := map [string ]interface {}{
@@ -1428,7 +1428,7 @@ func TestReconcileMachinePoolMachines(t *testing.T) {
1428
1428
"infrastructureMachineKind" : builder .GenericInfrastructureMachineKind ,
1429
1429
},
1430
1430
}
1431
- g .Expect (env .Create (ctx , & unstructured.Unstructured {Object : infraConfig })).To (Succeed ())
1431
+ g .Expect (env .CreateAndWait (ctx , & unstructured.Unstructured {Object : infraConfig })).To (Succeed ())
1432
1432
1433
1433
r := & MachinePoolReconciler {
1434
1434
Client : env ,
@@ -1487,7 +1487,7 @@ func TestReconcileMachinePoolMachines(t *testing.T) {
1487
1487
},
1488
1488
},
1489
1489
}
1490
- g .Expect (env .Create (ctx , & unstructured.Unstructured {Object : infraConfig })).To (Succeed ())
1490
+ g .Expect (env .CreateAndWait (ctx , & unstructured.Unstructured {Object : infraConfig })).To (Succeed ())
1491
1491
1492
1492
r := & MachinePoolReconciler {
1493
1493
Client : env ,
0 commit comments