@@ -48,10 +48,15 @@ public static T GetOperationStatus<T>(RestAzureNS.AzureOperationResponse respons
48
48
while ( opStatusResponse . Body . Status ==
49
49
ServiceClientModel . OperationStatusValues . InProgress )
50
50
{
51
- if ( String . Compare ( testMode , "Playback" , StringComparison . OrdinalIgnoreCase ) != 0 && ! TestMockSupport . RunningMocked )
51
+ if ( ! TestMockSupport . RunningMocked )
52
+ {
53
+ TestMockSupport . Delay ( _defaultSleepForOperationTracking * 1000 ) ;
54
+ }
55
+ if ( String . Compare ( testMode , "Record" , StringComparison . OrdinalIgnoreCase ) == 0 )
52
56
{
53
57
Thread . Sleep ( 5000 ) ;
54
58
}
59
+
55
60
opStatusResponse = getOpStatus ( operationId ) ;
56
61
}
57
62
@@ -79,7 +84,11 @@ public static T GetOperationStatus<T, S>(RestAzureNS.AzureOperationResponse<S> r
79
84
while ( opStatusResponse . Body . Status ==
80
85
ServiceClientModel . OperationStatusValues . InProgress )
81
86
{
82
- if ( String . Compare ( testMode , "Playback" , StringComparison . OrdinalIgnoreCase ) != 0 && ! TestMockSupport . RunningMocked )
87
+ if ( ! TestMockSupport . RunningMocked )
88
+ {
89
+ TestMockSupport . Delay ( _defaultSleepForOperationTracking * 1000 ) ;
90
+ }
91
+ if ( String . Compare ( testMode , "Record" , StringComparison . OrdinalIgnoreCase ) == 0 )
83
92
{
84
93
Thread . Sleep ( 5000 ) ;
85
94
}
@@ -109,10 +118,15 @@ public static RestAzureNS.AzureOperationResponse GetOperationResult(
109
118
string testMode = Environment . GetEnvironmentVariable ( "AZURE_TEST_MODE" ) ;
110
119
while ( opStatusResponse . Response . StatusCode == SystemNet . HttpStatusCode . Accepted )
111
120
{
112
- if ( String . Compare ( testMode , "Playback" , StringComparison . OrdinalIgnoreCase ) != 0 && ! TestMockSupport . RunningMocked )
121
+ if ( ! TestMockSupport . RunningMocked )
122
+ {
123
+ TestMockSupport . Delay ( _defaultSleepForOperationTracking * 1000 ) ;
124
+ }
125
+ if ( String . Compare ( testMode , "Record" , StringComparison . OrdinalIgnoreCase ) == 0 )
113
126
{
114
127
Thread . Sleep ( 5000 ) ;
115
128
}
129
+
116
130
opStatusResponse = getOpStatus ( operationId ) ;
117
131
}
118
132
@@ -139,10 +153,15 @@ public static RestAzureNS.AzureOperationResponse<T> GetOperationStatusDataMove<T
139
153
string testMode = Environment . GetEnvironmentVariable ( "AZURE_TEST_MODE" ) ;
140
154
while ( opStatusResponse . Body . Status == "InProgress" )
141
155
{
142
- if ( String . Compare ( testMode , "Playback" , StringComparison . OrdinalIgnoreCase ) != 0 && ! TestMockSupport . RunningMocked )
156
+ if ( ! TestMockSupport . RunningMocked )
157
+ {
158
+ TestMockSupport . Delay ( _defaultSleepForOperationTracking * 1000 ) ;
159
+ }
160
+ if ( String . Compare ( testMode , "Record" , StringComparison . OrdinalIgnoreCase ) == 0 )
143
161
{
144
162
Thread . Sleep ( 5000 ) ;
145
163
}
164
+
146
165
opStatusResponse = getOpStatus ( operationId ) ;
147
166
}
148
167
opStatusResponse = getOpStatus ( operationId ) ;
@@ -168,10 +187,15 @@ public static RestAzureNS.AzureOperationResponse<T> GetOperationResult<T>(
168
187
string testMode = Environment . GetEnvironmentVariable ( "AZURE_TEST_MODE" ) ;
169
188
while ( opStatusResponse . Response . StatusCode == SystemNet . HttpStatusCode . Accepted )
170
189
{
171
- if ( String . Compare ( testMode , "Playback" , StringComparison . OrdinalIgnoreCase ) != 0 && ! TestMockSupport . RunningMocked )
190
+ if ( ! TestMockSupport . RunningMocked )
191
+ {
192
+ TestMockSupport . Delay ( _defaultSleepForOperationTracking * 1000 ) ;
193
+ }
194
+ if ( String . Compare ( testMode , "Record" , StringComparison . OrdinalIgnoreCase ) == 0 )
172
195
{
173
196
Thread . Sleep ( 5000 ) ;
174
197
}
198
+
175
199
opStatusResponse = getOpStatus ( operationId ) ;
176
200
}
177
201
opStatusResponse = getOpStatus ( operationId ) ;
@@ -212,10 +236,15 @@ public static RestAzureNS.AzureOperationResponse<T> GetOperationResult<T>(
212
236
string testMode = Environment . GetEnvironmentVariable ( "AZURE_TEST_MODE" ) ;
213
237
while ( opStatusResponse . Response . StatusCode == SystemNet . HttpStatusCode . Accepted )
214
238
{
215
- if ( String . Compare ( testMode , "Playback" , StringComparison . OrdinalIgnoreCase ) != 0 && ! TestMockSupport . RunningMocked )
239
+ if ( ! TestMockSupport . RunningMocked )
240
+ {
241
+ TestMockSupport . Delay ( _defaultSleepForOperationTracking * 1000 ) ;
242
+ }
243
+ if ( String . Compare ( testMode , "Record" , StringComparison . OrdinalIgnoreCase ) == 0 )
216
244
{
217
245
Thread . Sleep ( 5000 ) ;
218
246
}
247
+
219
248
opStatusResponse = getOpStatus ( operationId ) ;
220
249
}
221
250
0 commit comments