You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/03/19 11:38:37 UTC

(pulsar) branch master updated: [fix][test] Fix flaky ReplicatorTest.testResumptionAfterBacklogRelaxed (#25358)

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 74f4e5a123b [fix][test] Fix flaky ReplicatorTest.testResumptionAfterBacklogRelaxed (#25358)
74f4e5a123b is described below

commit 74f4e5a123be1224ea5e9c81be117c057e400850
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Thu Mar 19 04:38:30 2026 -0700

    [fix][test] Fix flaky ReplicatorTest.testResumptionAfterBacklogRelaxed (#25358)
---
 .../test/java/org/apache/pulsar/broker/service/ReplicatorTest.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
index 0980c1869c1..605e1cd7ae3 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
@@ -1046,8 +1046,10 @@ public class ReplicatorTest extends ReplicatorTestBase {
 
         metrics = metricReader1.collectAllMetrics();
         assertMetricLongSumValue(metrics, OpenTelemetryReplicatorStats.BACKLOG_COUNTER, attributes, 1);
+        // The delay can be 0.0 when the replicator producer is stopped (e.g. due to backlog quota),
+        // because AbstractReplicator.getReplicationDelayMs() returns 0 when producer is null.
         assertMetricDoubleGaugeValue(metrics, OpenTelemetryReplicatorStats.DELAY_GAUGE, attributes,
-                aDouble -> assertThat(aDouble).isPositive());
+                aDouble -> assertThat(aDouble).isGreaterThanOrEqualTo(0.0));
 
         // Consumer will now drain 1 message and the replication backlog will be cleared
         consumer2.receive(1);