Skip to content

Commit

Permalink
Fixed issue when mimicing long running operation for test in Playback…
Browse files Browse the repository at this point in the history
… mode. (#18490)
  • Loading branch information
vidai-msft authored Jun 14, 2022
1 parent 567d576 commit a5e2a83
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static T GetOperationStatus<T>(RestAzureNS.AzureOperationResponse respons
while (opStatusResponse.Body.Status == ServiceClientModel.OperationStatusValues.InProgress)
{
TestMockSupport.Delay(_defaultSleepForOperationTracking * 1000);
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || TestMockSupport.RunningMocked)
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || !TestMockSupport.RunningMocked)
{
Thread.Sleep(5000);
}
Expand Down Expand Up @@ -80,7 +80,7 @@ public static T GetOperationStatus<T, S>(RestAzureNS.AzureOperationResponse<S> r
ServiceClientModel.OperationStatusValues.InProgress)
{
TestMockSupport.Delay(_defaultSleepForOperationTracking * 1000);
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || TestMockSupport.RunningMocked)
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || !TestMockSupport.RunningMocked)
{
Thread.Sleep(5000);
}
Expand Down Expand Up @@ -111,7 +111,7 @@ public static RestAzureNS.AzureOperationResponse GetOperationResult(
while (opStatusResponse.Response.StatusCode == SystemNet.HttpStatusCode.Accepted)
{
TestMockSupport.Delay(_defaultSleepForOperationTracking * 1000);
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || TestMockSupport.RunningMocked)
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || !TestMockSupport.RunningMocked)
{
Thread.Sleep(5000);
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public static RestAzureNS.AzureOperationResponse<T> GetOperationStatusDataMove<T
while (opStatusResponse.Body.Status == "InProgress")
{
TestMockSupport.Delay(_defaultSleepForOperationTracking * 1000);
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || TestMockSupport.RunningMocked)
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || !TestMockSupport.RunningMocked)
{
Thread.Sleep(5000);
}
Expand Down Expand Up @@ -172,7 +172,7 @@ public static RestAzureNS.AzureOperationResponse<T> GetOperationResult<T>(
while (opStatusResponse.Response.StatusCode == SystemNet.HttpStatusCode.Accepted)
{
TestMockSupport.Delay(_defaultSleepForOperationTracking * 1000);
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || TestMockSupport.RunningMocked)
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || !TestMockSupport.RunningMocked)
{
Thread.Sleep(5000);
}
Expand Down Expand Up @@ -217,7 +217,7 @@ public static RestAzureNS.AzureOperationResponse<T> GetOperationResult<T>(
while (opStatusResponse.Response.StatusCode == SystemNet.HttpStatusCode.Accepted)
{
TestMockSupport.Delay(_defaultSleepForOperationTracking * 1000);
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || TestMockSupport.RunningMocked)
if (String.Compare(testMode, "Record", StringComparison.OrdinalIgnoreCase) == 0 || !TestMockSupport.RunningMocked)
{
Thread.Sleep(5000);
}
Expand Down

0 comments on commit a5e2a83

Please sign in to comment.