This is an automated email from the ASF dual-hosted git repository.
merlimat 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 b75d780e55c [fix][test] Stabilize flaky
sweepTimeouts_abortsExpiredOpenTxnAndFansOut() test (#25952)
b75d780e55c is described below
commit b75d780e55cac4def830e3222903967f63254615
Author: Oneby Wang <[email protected]>
AuthorDate: Mon Jun 8 07:05:02 2026 +0800
[fix][test] Stabilize flaky sweepTimeouts_abortsExpiredOpenTxnAndFansOut()
test (#25952)
---
.../transaction/coordinator/v5/TransactionCoordinatorV5Test.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/coordinator/v5/TransactionCoordinatorV5Test.java
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/coordinator/v5/TransactionCoordinatorV5Test.java
index 9db63021dd9..26badeacf6c 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/coordinator/v5/TransactionCoordinatorV5Test.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/coordinator/v5/TransactionCoordinatorV5Test.java
@@ -272,9 +272,13 @@ public class TransactionCoordinatorV5Test {
@Test
public void sweepTimeouts_abortsExpiredOpenTxnAndFansOut() throws
Exception {
- // 1ms timeout → deadline already in the past when the sweep runs.
+ // Wait until the positive timeout has actually expired before running
the sweep.
TxnID txnId = tc.newTransaction(TC_ID, 1L, "owner").get();
String txnIdKey = TxnIds.toKey(txnId);
+ TxnHeader openHeader =
txnStore.getHeader(txnIdKey).get().orElseThrow().value();
+ long deadlineMs = openHeader.getCreatedAt().toEpochMilli() +
openHeader.getTimeout().toMillis();
+ Awaitility.await().until(() -> System.currentTimeMillis() >=
deadlineMs);
+
String segment = "segment://public/default/topic/0000-ffff-0";
txnStore.appendOp(txnIdKey,
new TxnOp(TxnOpKind.WRITE, segment, null, 5L, 1L, null)).get();