Skip to content

Commit 0b61008

Browse files
committed
Do not check credit notification in test
After the removal of an artificial delay on the broker, messages are dispatched faster and an inactive consumer does not trigger negative credit notification on CI.
1 parent 486d542 commit 0b61008

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/test/java/com/rabbitmq/stream/impl/SacClientTest.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.rabbitmq.stream.OffsetSpecification;
3434
import com.rabbitmq.stream.impl.Client.ClientParameters;
3535
import com.rabbitmq.stream.impl.Client.ConsumerUpdateListener;
36-
import com.rabbitmq.stream.impl.Client.CreditNotification;
3736
import com.rabbitmq.stream.impl.Client.MessageListener;
3837
import com.rabbitmq.stream.impl.Client.Response;
3938
import com.rabbitmq.stream.impl.TestUtils.BrokerVersionAtLeast;
@@ -534,20 +533,10 @@ void superStreamRebalancingShouldWorkWhilePublishing(TestInfo info) throws Excep
534533
lastDispatchedOffset.set(offset);
535534
receivedMessagesLatch.countDown();
536535
};
537-
AtomicInteger creditNotificationResponseCode = new AtomicInteger();
538-
// we keep track of credit errors
539-
// with the amount of initial credit and the rebalancing,
540-
// the first subscriber is likely to have in-flight credit commands
541-
// when it becomes inactive. The server should then send some credit
542-
// notifications to tell the client it's not supposed to ask for credits
543-
// for this subscription.
544-
CreditNotification creditNotification =
545-
(subscriptionId, responseCode) -> creditNotificationResponseCode.set(responseCode);
546536
ClientParameters clientParameters =
547537
new ClientParameters()
548538
.chunkListener(TestUtils.credit())
549539
.messageListener(messageListener)
550-
.creditNotification(creditNotification)
551540
.consumerUpdateListener(consumerUpdateListener);
552541
Client client1 = cf.get(clientParameters);
553542
Map<String, String> subscriptionProperties = new HashMap<>();
@@ -584,10 +573,6 @@ void superStreamRebalancingShouldWorkWhilePublishing(TestInfo info) throws Excep
584573

585574
waitAtMost(() -> consumerStates.get(b(1)));
586575

587-
waitAtMost(
588-
() ->
589-
creditNotificationResponseCode.get() == Constants.RESPONSE_CODE_PRECONDITION_FAILED);
590-
591576
Response response = client1.unsubscribe(b(0));
592577
assertThat(response).is(ok());
593578
response = client2.unsubscribe(b(1));

0 commit comments

Comments
 (0)