merlimat opened a new pull request, #25445:
URL: https://github.com/apache/pulsar/pull/25445
## Motivation
`KeySharedSubscriptionTest` was taking ~10 minutes to execute, mostly due to
unnecessary `Thread.sleep` calls, generous receive timeouts, and redundant
`PulsarClient` instance creation.
## Modifications
Replace artificial delays with condition-based waits or remove them entirely:
- Remove `Thread.sleep(100)` × 100 iterations in producer loop of
`testStickyKeyRangesRestartConsumers` (~10s saved)
- Remove `Thread.sleep(3000/5000/2000)` calls, replace with Awaitility
conditions where needed (~25s saved)
- Reduce ack timeout from 3s to 1s in `createConsumer`
- Reduce TTL from 3s to 1s in `testContinueDispatchMessagesWhenMessageTTL`
- Reduce `deliverAfter` from 10s to 1s in
`testContinueDispatchMessagesWhenMessageDelayed`
- Reduce `receive()` timeouts from 1-3s to 200-500ms for negative assertions
and "no more messages" probing
- Use shared `pulsarClient` in `testMakingProgressWithSlowerConsumer` instead
of creating 10 separate `PulsarClient` instances (~20s saved per variant)
- Call `redeliverUnacknowledgedMessages()` in `receiveAndCheck` for immediate
redelivery instead of waiting for ack timeout
## Verifying this change
All 105 tests in `KeySharedSubscriptionTest` pass (0 failures, 3 skipped).
Total execution time reduced from ~10 minutes to ~3 minutes.
## Documentation
- [x] `doc-not-needed`
## Matching PR in forked repository
_No response_
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]