Skip to content

Commit 92ddd11

Browse files
committed
missed a test
1 parent 1c8e2bc commit 92ddd11

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

sdk/client/resourcemanager/poller_provisioning_state_test.go

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -158,53 +158,53 @@ func TestPollerProvisioningState_OkWithNoBody_AfterPolling(t *testing.T) {
158158

159159
// (@jackofallops) removing this test for now as it does not represent real-world use or seem to exercise the
160160
// implementation?
161-
func TestPollerProvisioningState_InProvisioningState_DroppedThenInProgressThenSuccess(t *testing.T) {
162-
ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second)
163-
defer cancel()
164-
165-
// changing where we're setting this for the heck of it
166-
helper := newProvisioningStateEndpoint([]expectedResponse{
167-
responseWithStatusInProvisioningState(statusInProgress),
168-
responseThatDropsTheConnection(),
169-
responseWithStatusInProvisioningState(statusInProgress),
170-
responseWithStatusInProvisioningState(statusSucceeded),
171-
})
172-
server := httptest.NewServer(http.HandlerFunc(helper.endpoint(t)))
173-
defer server.Close()
174-
175-
resourceManagerClient := &Client{
176-
// NOTE: the use of a different API Version here is _intentional_ to ensure it's unused since we should be using
177-
// `apiVersion` (which otherwise gets parsed from the URI in `provisioningStatePollerFromResponse`)
178-
Client: client.NewClient(server.URL, "Example", "2015-01-01"),
179-
apiVersion: "2020-01-01",
180-
}
181-
poller := provisioningStatePoller{
182-
apiVersion: helper.expectedApiVersion,
183-
client: resourceManagerClient,
184-
initialRetryDuration: 10,
185-
originalUri: "/provisioning-state/poll",
186-
resourcePath: "/provisioning-state/poll",
187-
}
188-
189-
expectedStatuses := []pollers.PollingStatus{
190-
pollers.PollingStatusInProgress, // working on it
191-
// NOTE: the Dropped Connection will be ignored/silently retried
192-
pollers.PollingStatusInProgress, // working on it
193-
pollers.PollingStatusSucceeded, // good
194-
}
195-
for i, expected := range expectedStatuses {
196-
t.Logf("Poll %d..", i)
197-
result, err := poller.Poll(ctx)
198-
if err != nil {
199-
t.Fatal(err.Error())
200-
}
201-
if result.Status != expected {
202-
t.Fatalf("expected status to be %q but got %q", expected, result.Status)
203-
}
204-
}
205-
// sanity-checking - expect 4 calls but 3 statuses (since the dropped connection is silently retried)
206-
helper.assertCalled(t, 4)
207-
}
161+
// func TestPollerProvisioningState_InProvisioningState_DroppedThenInProgressThenSuccess(t *testing.T) {
162+
// ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second)
163+
// defer cancel()
164+
//
165+
// // changing where we're setting this for the heck of it
166+
// helper := newProvisioningStateEndpoint([]expectedResponse{
167+
// responseWithStatusInProvisioningState(statusInProgress),
168+
// responseThatDropsTheConnection(),
169+
// responseWithStatusInProvisioningState(statusInProgress),
170+
// responseWithStatusInProvisioningState(statusSucceeded),
171+
// })
172+
// server := httptest.NewServer(http.HandlerFunc(helper.endpoint(t)))
173+
// defer server.Close()
174+
//
175+
// resourceManagerClient := &Client{
176+
// // NOTE: the use of a different API Version here is _intentional_ to ensure it's unused since we should be using
177+
// // `apiVersion` (which otherwise gets parsed from the URI in `provisioningStatePollerFromResponse`)
178+
// Client: client.NewClient(server.URL, "Example", "2015-01-01"),
179+
// apiVersion: "2020-01-01",
180+
// }
181+
// poller := provisioningStatePoller{
182+
// apiVersion: helper.expectedApiVersion,
183+
// client: resourceManagerClient,
184+
// initialRetryDuration: 10,
185+
// originalUri: "/provisioning-state/poll",
186+
// resourcePath: "/provisioning-state/poll",
187+
// }
188+
//
189+
// expectedStatuses := []pollers.PollingStatus{
190+
// pollers.PollingStatusInProgress, // working on it
191+
// // NOTE: the Dropped Connection will be ignored/silently retried
192+
// pollers.PollingStatusInProgress, // working on it
193+
// pollers.PollingStatusSucceeded, // good
194+
// }
195+
// for i, expected := range expectedStatuses {
196+
// t.Logf("Poll %d..", i)
197+
// result, err := poller.Poll(ctx)
198+
// if err != nil {
199+
// t.Fatal(err.Error())
200+
// }
201+
// if result.Status != expected {
202+
// t.Fatalf("expected status to be %q but got %q", expected, result.Status)
203+
// }
204+
// }
205+
// // sanity-checking - expect 4 calls but 3 statuses (since the dropped connection is silently retried)
206+
// helper.assertCalled(t, 4)
207+
// }
208208

209209
// (@jackofallops) removing this test for now as it does not represent real-world use or seem to exercise the
210210
// implementation?

0 commit comments

Comments
 (0)