Skip to content

Conversation

@Ttpetrov
Copy link

@Ttpetrov Ttpetrov commented Nov 8, 2025

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:

  1. "Batch receive respects max size with large backlog" ✅
    • 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
  2. "Batch receive respects max size with large backlog and concurrent production" ❌ (Expected to Fail)
    • 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.

@Lanayx
Copy link
Member

Lanayx commented Nov 8, 2025

Thank you for an example of the failing test! I was able to locate the problem and cover it with much simpler unit tests here

@Lanayx Lanayx closed this Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants