@@ -1261,43 +1261,43 @@ func TestDeleteServiceInstance(t *testing.T) {
1261
1261
}
1262
1262
},
1263
1263
},
1264
- // {
1265
- // name: "deprovision instance after in progress provision",
1266
- // skipVerifyingInstanceSuccess: true,
1267
- // setup: func(ct *controllerTest) {
1268
- // ct.osbClient.PollLastOperationReaction = & fakeosb.PollLastOperationReaction{
1269
- // Response: &osb.LastOperationResponse {
1270
- // State: osb.StateInProgress,
1271
- // },
1272
- // }
1273
- // ct.osbClient.ProvisionReaction = &fakeosb.ProvisionReaction{
1274
- // Response: &osb.ProvisionResponse{
1275
- // Async: true,
1276
- // },
1277
- // }
1278
- // ct.osbClient.DeprovisionReaction = &fakeosb.DeprovisionReaction{
1279
- // Response: &osb.DeprovisionResponse{ },
1280
- // }
1281
- // },
1282
- // testFunction: func(ct *controllerTest) {
1283
- // verifyCondition := v1beta1.ServiceInstanceCondition{
1284
- // Type: v1beta1.ServiceInstanceConditionReady ,
1285
- // Status: v1beta1.ConditionFalse,
1286
- // Reason: "ProvisionRequestInFlight",
1287
- // }
1288
- // if err := util.WaitForInstanceCondition(ct.client, testNamespace, testInstanceName, verifyCondition); err != nil {
1289
- // t.Fatalf("error waiting for instance condition: %v", err)
1290
- // }
1291
- // ct.osbClient.PollLastOperationReaction = &fakeosb.PollLastOperationReaction {
1292
- // Response: &osb.LastOperationResponse{
1293
- // State: osb.StateSucceeded ,
1294
- // } ,
1295
- // }
1296
- // if err := util.WaitForInstanceReconciledGeneration (ct.client, testNamespace, testInstanceName, ct.instance.Status.ReconciledGeneration+1 ); err != nil {
1297
- // t.Fatalf("error waiting for instance to reconcile : %v", err)
1298
- // }
1299
- // },
1300
- // },
1264
+ {
1265
+ name : "deprovision instance after in progress provision" ,
1266
+ skipVerifyingInstanceSuccess : true ,
1267
+ setup : func (ct * controllerTest ) {
1268
+ ct .osbClient .PollLastOperationReaction = fakeosb .DynamicPollLastOperationReaction (
1269
+ getLastOperationResponseByPollCountReactions ( 2 , []fakeosb. PollLastOperationReaction {
1270
+ fakeosb. PollLastOperationReaction {
1271
+ Response : & osb. LastOperationResponse {
1272
+ State : osb . StateInProgress ,
1273
+ },
1274
+ },
1275
+ fakeosb. PollLastOperationReaction {
1276
+ Response : & osb. LastOperationResponse {
1277
+ State : osb . StateSucceeded ,
1278
+ },
1279
+ },
1280
+ }))
1281
+ ct . osbClient . ProvisionReaction = & fakeosb. ProvisionReaction {
1282
+ Response : & osb. ProvisionResponse {
1283
+ Async : true ,
1284
+ } ,
1285
+ }
1286
+ ct . osbClient . DeprovisionReaction = & fakeosb. DeprovisionReaction {
1287
+ Response : & osb. DeprovisionResponse {},
1288
+ }
1289
+ },
1290
+ testFunction : func ( ct * controllerTest ) {
1291
+ verifyCondition := v1beta1. ServiceInstanceCondition {
1292
+ Type : v1beta1 . ServiceInstanceConditionReady ,
1293
+ Status : v1beta1 . ConditionTrue ,
1294
+ Reason : "ProvisionedSuccessfully" ,
1295
+ }
1296
+ if err := util .WaitForInstanceCondition (ct .client , testNamespace , testInstanceName , verifyCondition ); err != nil {
1297
+ t .Fatalf ("error waiting for instance condition : %v" , err )
1298
+ }
1299
+ },
1300
+ },
1301
1301
}
1302
1302
1303
1303
for _ , tc := range cases {
0 commit comments