Skip to content

Dump network state when VirtualConsumerDemandTest misses a forwarded message - #2657

Open
jbonofre wants to merge 1 commit into
apache:mainfrom
jbonofre:diagnose-virtual-consumer-demand-flake
Open

jbonofre wants to merge 1 commit into
apache:mainfrom
jbonofre:diagnose-virtual-consumer-demand-flake

Conversation

@jbonofre

Copy link
Copy Markdown
Member

Related to #2238 (flaky test cleanup, VirtualConsumerDemandTest.testToTopicWithDurable:1358).

VirtualConsumerDemandTest.testToTopicWithDurable (and testToTopic, seen failing on main at line 1281) occasionally fails on CI at bridgeConsumer.receive(5000): the message never reaches the remote durable subscriber. I could not reproduce it locally (640 runs under CPU load on JDK 21), and ruled out two theories:

  • waitForConsumerCount is not satisfied prematurely: the local consumer count is 0 until the durable's demand propagates.
  • The bridge registers the demand subscription in subscriptionMapByLocalId before creating the local consumer, so it cannot drop the first message.

This PR is diagnostics only, not a fix. On a receive timeout it now fails with a dump of:

  • the include.* destinations on both brokers, with their statistics and subscriptions
  • the bridge statistics and demand subscriptions

so the next CI flake shows where the message was lost (local topic, bridge, or remote composite/durable). Test behaviour is otherwise unchanged. The helper replaces the 8 assertNotNull(bridgeConsumer.receive(5000)) calls in this class.

Verified locally: all 16 testTo* runs pass, and a forced timeout prints the expected dump.

🤖 Generated with Claude Code

…forwarded message

VirtualConsumerDemandTest.testToTopicWithDurable and testToTopic occasionally
fail on CI at bridgeConsumer.receive(5000) (see apache#2238) and cannot be reproduced
locally. On a receive timeout, dump the include.* destinations, their
subscriptions and statistics on both brokers, plus the bridge demand
subscriptions, so the next flaky failure shows where the message was lost.

Diagnostics only, no change to the test behaviour.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant