Skip to content

Fix and enable the replication StressTest#698

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:features/stress-test-window
Open

Fix and enable the replication StressTest#698
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:features/stress-test-window

Conversation

@vharseko

@vharseko vharseko commented Jul 4, 2026

Copy link
Copy Markdown
Member

Problem

StressTest.fromServertoBroker has been disabled since the ForgeRock era. Once enabled, it fails with:

java.lang.AssertionError: some messages were lost expected [1000] but found [99]

The loss is exactly one flow-control window (windowSize=100: one message consumed by the main thread plus 99 by the reader). The test's BrokerReader loops on ReplicationBroker.receive() without ever calling updateWindowAfterReplay(). receive() only decrements the receive window; publishing the WindowMsg acknowledgements is the consumer's job — the real replay threads do it after processing each update. So the replication server rightfully stopped sending after the first window: the server behaves correctly, the test violated the flow-control protocol.

Fix

Acknowledge the window after each received UpdateMsg in the reader, enable the test and move it into the default build.

Verification

Three consecutive runs: 1000/1000 messages received, ~18s each; plus one run under the default CI group filter — green.

The test was disabled and, once enabled, lost exactly one flow-control
window of messages ("some messages were lost expected [1000] but found
[99]"): its BrokerReader looped on ReplicationBroker.receive() without
ever calling updateWindowAfterReplay(). receive() only decrements the
receive window; publishing the WindowMsg acknowledgements is the
consumer's job (the real replay threads do it), so the replication
server rightfully stopped sending after windowSize messages - one
consumed by the main thread plus 99 by the reader.

Acknowledge the window after each received update, enable the test and
move it into the default build (~18 seconds).
@vharseko vharseko added tests Test suites: fixing, enabling, un-disabling replication labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI replication tests Test suites: fixing, enabling, un-disabling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants