@@ -31,7 +31,24 @@ public class KeyVaultTestFixture : IDisposable
3131 public string keyVersion ;
3232 public KeyIdentifier keyIdentifier ;
3333 public ClientCredential clientCredential ;
34- public RetryPolicy retryExecutor ;
34+ public RetryPolicy retryExecutor
35+ {
36+ get
37+ {
38+ switch ( HttpMockServer . Mode )
39+ {
40+ case HttpRecorderMode . None :
41+ return new RetryPolicy < SoftDeleteErrorDetectionStrategy > ( new FixedIntervalRetryStrategy ( 5 , TimeSpan . FromSeconds ( 5.0 ) ) ) ;
42+ case HttpRecorderMode . Record :
43+ return new RetryPolicy < SoftDeleteErrorDetectionStrategy > ( new ExponentialBackoffRetryStrategy ( 8 , TimeSpan . FromSeconds ( 1 ) , TimeSpan . FromSeconds ( 60 ) , TimeSpan . FromSeconds ( 5 ) ) ) ;
44+ case HttpRecorderMode . Playback :
45+ return new RetryPolicy < SoftDeleteErrorDetectionStrategy > ( new FixedIntervalRetryStrategy ( 5 , TimeSpan . Zero ) ) ;
46+ default :
47+ throw new NotSupportedException ( $ "{ HttpMockServer . Mode } is not supported") ;
48+ }
49+ }
50+ }
51+
3552 public string StorageResourceUrl1 ;
3653 public string StorageResourceUrl2 ;
3754
@@ -58,10 +75,6 @@ public KeyVaultTestFixture()
5875 keyVersion = keyIdentifier . Version ;
5976 tokenCache = new TokenCache ( ) ;
6077 _deviceCodeForStorageTests = null ;
61- retryExecutor = new RetryPolicy < SoftDeleteErrorDetectionStrategy > ( new ExponentialBackoffRetryStrategy ( 8 , TimeSpan . FromSeconds ( 1 ) , TimeSpan . FromSeconds ( 60 ) , TimeSpan . FromSeconds ( 5 ) ) ) ;
62- } else
63- {
64- retryExecutor = new RetryPolicy < SoftDeleteErrorDetectionStrategy > ( new FixedIntervalRetryStrategy ( 5 , TimeSpan . FromSeconds ( 5.0 ) ) ) ;
6578 }
6679 }
6780
0 commit comments