4343import java .time .format .DateTimeFormatter ;
4444import java .util .Collections ;
4545import java .util .List ;
46+ import java .util .Random ;
4647import java .util .concurrent .ExecutorService ;
4748import java .util .concurrent .Executors ;
4849import java .util .concurrent .ThreadFactory ;
@@ -68,7 +69,7 @@ public class RecoveryClusterTest {
6869
6970 private static final Logger LOGGER = LoggerFactory .getLogger (RecoveryClusterTest .class );
7071
71- static final Duration TIMEOUT = Duration .ofSeconds (20 );
72+ static final Duration TIMEOUT = Duration .ofSeconds (35 );
7273 static final String [] URIS =
7374 new String [] {"amqp://localhost:5672" , "amqp://localhost:5673" , "amqp://localhost:5674" };
7475 static final Duration RECOVERY_INITIAL_DELAY = Duration .ofSeconds (10 );
@@ -333,30 +334,26 @@ void clusterRestart() {
333334 private List <QueueConfiguration > queueConfigurations (
334335 List <Management .QueueType > queueTypes , int queueCount ) {
335336 AtomicInteger classicQueueCount = new AtomicInteger (0 );
337+ String suffix = "rec-" + new Random ().nextInt (1000 );
336338 return queueTypes .stream ()
337339 .flatMap (
338340 (Function <Management .QueueType , Stream <QueueConfiguration >>)
339341 type ->
340342 IntStream .range (0 , queueCount )
341343 .mapToObj (
342- ignored -> {
344+ i -> {
343345 boolean exclusive =
344346 type == Management .QueueType .CLASSIC
345347 && classicQueueCount .incrementAndGet () > queueCount ;
346- String prefix =
347- type .name ().toLowerCase () + (exclusive ? "-ex-" : "-" );
348- String n = name (prefix );
348+ String prefix = type .name ().toLowerCase () + (exclusive ? "-ex" : "" );
349+ String n = String .format ("%s-%s-%02d" , prefix , suffix , i );
349350 UnaryOperator <Management .QueueSpecification > c =
350351 s -> s .type (type ).exclusive (exclusive );
351352 return new QueueConfiguration (n , type , exclusive , c );
352353 }))
353354 .collect (toList ());
354355 }
355356
356- String name (String prefix ) {
357- return prefix + TestUtils .name (this .testInfo );
358- }
359-
360357 private static class PublisherState implements AutoCloseable {
361358
362359 private static final ThreadFactory THREAD_FACTORY =
0 commit comments