23
23
import static com .rabbitmq .client .amqp .impl .TestUtils .sync ;
24
24
import static com .rabbitmq .client .amqp .impl .TestUtils .waitAtMost ;
25
25
import static java .time .Duration .ofMillis ;
26
+ import static java .time .Duration .ofSeconds ;
26
27
import static org .assertj .core .api .Assertions .assertThat ;
27
28
28
29
import com .rabbitmq .client .amqp .*;
37
38
import org .junit .jupiter .params .ParameterizedTest ;
38
39
import org .junit .jupiter .params .provider .EnumSource ;
39
40
40
- @ TestUtils .DisabledIfNotCluster
41
+ // @TestUtils.DisabledIfNotCluster
41
42
public class ClusterTest {
42
43
43
44
static final BackOffDelayPolicy BACK_OFF_DELAY_POLICY = BackOffDelayPolicy .fixed (ofMillis (100 ));
@@ -319,13 +320,16 @@ void consumeFromQuorumQueueWhenLeaderIsPaused() {
319
320
nodePaused = true ;
320
321
321
322
publisher .publish (publisher .message ().messageId (2L ), ctx -> publishSync .down ());
322
- assertThat (publishSync ).completes ();
323
+
324
+ assertThat (publishSync ).completes (ofSeconds (20 ));
323
325
publishSync .reset ();
324
326
325
327
assertThat (consumeSync ).completes ();
326
328
assertThat (messageIds ).containsExactlyInAnyOrder (1L , 2L );
327
329
consumeSync .reset ();
328
330
331
+ assertThat (initialFollowers ).contains (mgmt .queueInfo (q ).leader ());
332
+
329
333
Cli .unpauseNode (initialLeader );
330
334
nodePaused = false ;
331
335
@@ -335,7 +339,6 @@ void consumeFromQuorumQueueWhenLeaderIsPaused() {
335
339
336
340
assertThat (consumeSync ).completes ();
337
341
assertThat (messageIds ).containsExactlyInAnyOrder (1L , 2L , 3L );
338
- consumeSync .reset ();
339
342
340
343
waitAtMost (() -> initialFollowers .contains (mgmt .queueInfo (q ).leader ()));
341
344
} finally {
@@ -451,7 +454,7 @@ String deleteLeader(Consumer<String> deleteMemberOperation) {
451
454
String initialLeader = info .leader ();
452
455
int initialReplicaCount = info .replicas ().size ();
453
456
deleteMemberOperation .accept (initialLeader );
454
- TestUtils .waitAtMost (() -> !queueInfo ().leader (). equals ( initialLeader ));
457
+ TestUtils .waitAtMost (() -> !initialLeader . equals ( queueInfo ().leader ()));
455
458
assertThat (queueInfo ().replicas ()).hasSize (initialReplicaCount - 1 );
456
459
return initialLeader ;
457
460
}
0 commit comments