Integration Tests for BatchReceiveAsync #335
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Environment used .Net 8.0 C#/Pulsar Server4.0.0
Summary: Added two new integration tests for batch receive functionality to verify correct behavior with message backlogs.
Tests Added:
• Verifies that BatchReceiveAsync() respects the configured maxBatchSize (8 messages) when consuming from a large pre-existing backlog (2000 messages)
• Produces all messages BEFORE consumer subscription to ensure backlog exists
• Validates that no batch exceeds the configured maximum size
• This test is currently failing and is EXPECTED to fail
• Demonstrates a potential bug/limitation where batch size limits are violated when:
• A large backlog exists (2000 messages)
• Additional messages are continuously produced during consumption (1000 more messages)
• Consumer has simulated processing delays (500ms per batch)
• The failure reveals that concurrent production + backlog may cause BatchReceiveAsync() to return batches larger than the configured maxBatchSize
Purpose: The second test documents the reproduction case for investigation and future fix. It should remain as a failing test until the underlying issue is resolved.