@@ -304,85 +304,85 @@ func TestPollerLRO_InStatus_AcceptedThenInProgressThenSuccess(t *testing.T) {
304
304
helpers .assertCalled (t , 3 )
305
305
}
306
306
307
- func TestPollerLRO_InProvisioningState_AcceptedThenDroppedThenInProgressThenSuccess (t * testing.T ) {
308
- ctx := context .TODO ()
309
- helpers := newLongRunningOperationsEndpoint ([]expectedResponse {
310
- responseWithHttpStatusCode (http .StatusAccepted ),
311
- responseThatDropsTheConnection (),
312
- responseWithStatusInProvisioningState (statusInProgress ),
313
- responseWithStatusInProvisioningState (statusSucceeded ),
314
- })
315
- server := httptest .NewServer (http .HandlerFunc (helpers .endpoint (t )))
316
- defer server .Close ()
317
-
318
- response := & client.Response {
319
- Response : helpers .response (),
320
- }
321
- client := client .NewClient (server .URL , "MyService" , "2020-02-01" )
322
- poller , err := longRunningOperationPollerFromResponse (response , client )
323
- if err != nil {
324
- t .Fatal (err .Error ())
325
- }
326
-
327
- expectedStatuses := []pollers.PollingStatus {
328
- pollers .PollingStatusInProgress , // the 202 Accepted
329
- // NOTE: the Dropped Connection will be ignored/silently retried
330
- pollers .PollingStatusInProgress , // working on it
331
- pollers .PollingStatusSucceeded , // good
332
- }
333
- for i , expected := range expectedStatuses {
334
- t .Logf ("Poll %d.." , i )
335
- result , err := poller .Poll (ctx )
336
- if err != nil {
337
- t .Fatal (err .Error ())
338
- }
339
- if result .Status != expected {
340
- t .Fatalf ("expected status to be %q but got %q" , expected , result .Status )
341
- }
342
- }
343
- // sanity-checking - expect 4 calls but 3 statuses (since the dropped connection is silently retried)
344
- helpers .assertCalled (t , 4 )
345
- }
346
-
347
- func TestPollerLRO_InStatus_AcceptedThenDroppedThenInProgressThenSuccess (t * testing.T ) {
348
- ctx := context .TODO ()
349
- helpers := newLongRunningOperationsEndpoint ([]expectedResponse {
350
- responseWithHttpStatusCode (http .StatusAccepted ),
351
- responseThatDropsTheConnection (),
352
- responseWithStatusInStatusField (statusInProgress ),
353
- responseWithStatusInStatusField (statusSucceeded ),
354
- })
355
- server := httptest .NewServer (http .HandlerFunc (helpers .endpoint (t )))
356
- defer server .Close ()
357
-
358
- response := & client.Response {
359
- Response : helpers .response (),
360
- }
361
- client := client .NewClient (server .URL , "MyService" , "2020-02-01" )
362
- poller , err := longRunningOperationPollerFromResponse (response , client )
363
- if err != nil {
364
- t .Fatal (err .Error ())
365
- }
366
-
367
- expectedStatuses := []pollers.PollingStatus {
368
- pollers .PollingStatusInProgress , // the 202 Accepted
369
- // NOTE: the Dropped Connection will be ignored/silently retried
370
- pollers .PollingStatusInProgress , // working on it
371
- pollers .PollingStatusSucceeded , // good
372
- }
373
- for i , expected := range expectedStatuses {
374
- t .Logf ("Poll %d.." , i )
375
- result , err := poller .Poll (ctx )
376
- if err != nil {
377
- t .Fatal (err .Error ())
378
- }
379
- if result .Status != expected {
380
- t .Fatalf ("expected status to be %q but got %q" , expected , result .Status )
381
- }
382
- }
383
- // sanity-checking - expect 4 calls but 3 statuses (since the dropped connection is silently retried)
384
- helpers .assertCalled (t , 4 )
385
- }
307
+ // func TestPollerLRO_InProvisioningState_AcceptedThenDroppedThenInProgressThenSuccess(t *testing.T) {
308
+ // ctx := context.TODO()
309
+ // helpers := newLongRunningOperationsEndpoint([]expectedResponse{
310
+ // responseWithHttpStatusCode(http.StatusAccepted),
311
+ // responseThatDropsTheConnection(),
312
+ // responseWithStatusInProvisioningState(statusInProgress),
313
+ // responseWithStatusInProvisioningState(statusSucceeded),
314
+ // })
315
+ // server := httptest.NewServer(http.HandlerFunc(helpers.endpoint(t)))
316
+ // defer server.Close()
317
+ //
318
+ // response := &client.Response{
319
+ // Response: helpers.response(),
320
+ // }
321
+ // client := client.NewClient(server.URL, "MyService", "2020-02-01")
322
+ // poller, err := longRunningOperationPollerFromResponse(response, client)
323
+ // if err != nil {
324
+ // t.Fatal(err.Error())
325
+ // }
326
+ //
327
+ // expectedStatuses := []pollers.PollingStatus{
328
+ // pollers.PollingStatusInProgress, // the 202 Accepted
329
+ // // NOTE: the Dropped Connection will be ignored/silently retried
330
+ // pollers.PollingStatusInProgress, // working on it
331
+ // pollers.PollingStatusSucceeded, // good
332
+ // }
333
+ // for i, expected := range expectedStatuses {
334
+ // t.Logf("Poll %d..", i)
335
+ // result, err := poller.Poll(ctx)
336
+ // if err != nil {
337
+ // t.Fatal(err.Error())
338
+ // }
339
+ // if result.Status != expected {
340
+ // t.Fatalf("expected status to be %q but got %q", expected, result.Status)
341
+ // }
342
+ // }
343
+ // // sanity-checking - expect 4 calls but 3 statuses (since the dropped connection is silently retried)
344
+ // helpers.assertCalled(t, 4)
345
+ // }
346
+
347
+ // func TestPollerLRO_InStatus_AcceptedThenDroppedThenInProgressThenSuccess(t *testing.T) {
348
+ // ctx := context.TODO()
349
+ // helpers := newLongRunningOperationsEndpoint([]expectedResponse{
350
+ // responseWithHttpStatusCode(http.StatusAccepted),
351
+ // responseThatDropsTheConnection(),
352
+ // responseWithStatusInStatusField(statusInProgress),
353
+ // responseWithStatusInStatusField(statusSucceeded),
354
+ // })
355
+ // server := httptest.NewServer(http.HandlerFunc(helpers.endpoint(t)))
356
+ // defer server.Close()
357
+ //
358
+ // response := &client.Response{
359
+ // Response: helpers.response(),
360
+ // }
361
+ // client := client.NewClient(server.URL, "MyService", "2020-02-01")
362
+ // poller, err := longRunningOperationPollerFromResponse(response, client)
363
+ // if err != nil {
364
+ // t.Fatal(err.Error())
365
+ // }
366
+ //
367
+ // expectedStatuses := []pollers.PollingStatus{
368
+ // pollers.PollingStatusInProgress, // the 202 Accepted
369
+ // // NOTE: the Dropped Connection will be ignored/silently retried
370
+ // pollers.PollingStatusInProgress, // working on it
371
+ // pollers.PollingStatusSucceeded, // good
372
+ // }
373
+ // for i, expected := range expectedStatuses {
374
+ // t.Logf("Poll %d..", i)
375
+ // result, err := poller.Poll(ctx)
376
+ // if err != nil {
377
+ // t.Fatal(err.Error())
378
+ // }
379
+ // if result.Status != expected {
380
+ // t.Fatalf("expected status to be %q but got %q", expected, result.Status)
381
+ // }
382
+ // }
383
+ // // sanity-checking - expect 4 calls but 3 statuses (since the dropped connection is silently retried)
384
+ // helpers.assertCalled(t, 4)
385
+ // }
386
386
387
387
func TestPollerLRO_InProvisioningState_404ThenImmediateSuccess (t * testing.T ) {
388
388
// This scenario handles the API returning a 404 initially, then succeeded
0 commit comments