This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 7cf36f8702c [fix][test] Fix flaky
ReplicatorTest.testResumptionAfterBacklogRelaxed (#25358)
7cf36f8702c is described below
commit 7cf36f8702cd492d92c51166256dd218bae0dedd
Author: Matteo Merli <[email protected]>
AuthorDate: Thu Mar 19 04:38:30 2026 -0700
[fix][test] Fix flaky ReplicatorTest.testResumptionAfterBacklogRelaxed
(#25358)
(cherry picked from commit 74f4e5a123be1224ea5e9c81be117c057e400850)
---
.../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 db3b8eaae1b..84899d8dc4f 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
@@ -1047,8 +1047,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);