You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "nodece (via GitHub)" <gi...@apache.org> on 2026/05/14 11:04:20 UTC
[PR] test: fix TestPriorityConsumer [pulsar-client-go]
nodece opened a new pull request, #1495:
URL: https://github.com/apache/pulsar-client-go/pull/1495
### Motivation
`TestPriorityConsumer` was failing with `context.deadlineExceededError` because the original test only sent 10 messages to 2 priority-1 consumers and passively asserted exact delivery counts (consumer1 gets 5, consumer2 gets 5). This is fragile — the broker distributes messages among consumers with available permits, so the exact count per consumer is not deterministic when messages are still being dispatched.
The Java reference test validates priority dispatch differently: it actively drains messages from specific consumers to replenish their flow-control permits, then sends additional messages and asserts the low-priority consumer receives nothing.
### Modifications
Rewrite `TestPriorityConsumer` to align with the Java reference implementation (`PriorityConsumerTest` in `DispatcherTest.java`):
1. Send 15 messages (distributed among all priority-1 consumers)
2. Drain 20 messages each from consumer1 and consumer2 to replenish their individual permits — now they have more available permits than consumer3 at the same priority level
3. Send 5 more messages — the broker should only dispatch to consumer1/consumer2 because they have more permits
4. Assert consumer3 (priority 2) receives nothing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test: fix TestPriorityConsumer [pulsar-client-go]
Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie merged PR #1495:
URL: https://github.com/apache/pulsar-client-go/pull/1495
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org