@@ -84,16 +84,9 @@ public abstract class IntegrationFixture : IAsyncLifetime
8484 public static readonly TimeSpan RecoveryInterval = TimeSpan . FromSeconds ( 2 ) ;
8585 public static readonly TimeSpan TestTimeout = TimeSpan . FromSeconds ( 5 ) ;
8686 public static readonly TimeSpan RequestedConnectionTimeout = TimeSpan . FromSeconds ( 1 ) ;
87- public static readonly Random S_Random ;
8887
8988 static IntegrationFixture ( )
9089 {
91-
92- #if NET
93- S_Random = Random . Shared ;
94- #else
95- S_Random = new Random ( ) ;
96- #endif
9790 s_isRunningInCI = InitIsRunningInCI ( ) ;
9891 s_isVerbose = InitIsVerbose ( ) ;
9992
@@ -450,12 +443,19 @@ protected async Task WithTemporaryChannelAsync(Func<IChannel, Task> action)
450443
451444 protected string GenerateExchangeName ( )
452445 {
453- return $ "{ _testDisplayName } -exchange-{ Guid . NewGuid ( ) } ";
446+ return $ "{ _testDisplayName } -exchange-{ Now } - { GenerateShortUuid ( ) } ";
454447 }
455448
456- protected string GenerateQueueName ( )
449+ protected string GenerateQueueName ( bool useGuid = false )
457450 {
458- return $ "{ _testDisplayName } -queue-{ Guid . NewGuid ( ) } ";
451+ if ( useGuid )
452+ {
453+ return $ "{ _testDisplayName } -queue-{ Now } -{ Guid . NewGuid ( ) } ";
454+ }
455+ else
456+ {
457+ return $ "{ _testDisplayName } -queue-{ Now } -{ GenerateShortUuid ( ) } ";
458+ }
459459 }
460460
461461 protected Task WithTemporaryNonExclusiveQueueAsync ( Func < IChannel , string , Task > action )
@@ -540,7 +540,7 @@ protected ConnectionFactory CreateConnectionFactory(
540540 {
541541 return new ConnectionFactory
542542 {
543- ClientProvidedName = $ "{ _testDisplayName } :{ Util . Now } :{ GetConnectionIdx ( ) } ",
543+ ClientProvidedName = $ "{ _testDisplayName } :{ Now } :{ GetConnectionIdx ( ) } ",
544544 ContinuationTimeout = WaitSpan ,
545545 HandshakeContinuationTimeout = WaitSpan ,
546546 ConsumerDispatchConcurrency = consumerDispatchConcurrency
@@ -631,10 +631,16 @@ protected static string GetUniqueString(ushort length)
631631 protected static byte [ ] GetRandomBody ( ushort size = 1024 )
632632 {
633633 byte [ ] body = new byte [ size ] ;
634- S_Random . NextBytes ( body ) ;
634+ Util . S_Random . NextBytes ( body ) ;
635635 return body ;
636636 }
637637
638+ protected static string Now => Util . Now ;
639+
640+ protected static string GenerateShortUuid ( ) => Util . GenerateShortUuid ( ) ;
641+
642+ protected static int RandomNext ( int min , int max ) => Util . S_Random . Next ( min , max ) ;
643+
638644 protected static Task WaitForRecoveryAsync ( IConnection conn )
639645 {
640646 TaskCompletionSource < bool > tcs = PrepareForRecovery ( ( AutorecoveringConnection ) conn ) ;
0 commit comments