From 1b066d9f565417b1edf7e63748fb3746d8928570 Mon Sep 17 00:00:00 2001 From: Valera V Harseko Date: Sat, 4 Jul 2026 18:33:46 +0300 Subject: [PATCH] Fix and enable the replication StressTest 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). --- .../java/org/opends/server/replication/StressTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java index a045aa56c1..f286297ac5 100644 --- a/opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java +++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java @@ -13,6 +13,7 @@ * * Copyright 2006-2010 Sun Microsystems, Inc. * Portions Copyright 2013-2016 ForgeRock AS. + * Portions Copyright 2026 3A Systems, LLC */ package org.opends.server.replication; @@ -38,6 +39,7 @@ import org.opends.server.protocols.internal.InternalClientConnection; import org.opends.server.replication.protocol.AddMsg; import org.opends.server.replication.protocol.ReplicationMsg; +import org.opends.server.replication.protocol.UpdateMsg; import org.opends.server.replication.service.ReplicationBroker; import org.opends.server.types.Entry; import org.opends.server.types.InitializationException; @@ -62,7 +64,7 @@ public class StressTest extends ReplicationTestCase /** Stress test from LDAP server to client using the ReplicationBroker API. */ - @Test(enabled=false, groups="slow") + @Test public void fromServertoBroker() throws Exception { logger.error(LocalizableMessage.raw("Starting replication StressTest : fromServertoBroker")); @@ -264,6 +266,12 @@ public void run() { break; } + if (msg instanceof UpdateMsg) + { + // Acknowledge the flow control window, otherwise the replication + // server stops sending after windowSize messages. + broker.updateWindowAfterReplay(); + } count ++; } } catch (Exception e)