Skip to content

Commit 78c24a0

Browse files
committed
[fix][broker] Flaky-test: TopicTransactionBufferTest.testMessagePublishInOrder (#24788)
Signed-off-by: Dream95 <[email protected]>
1 parent 7d35d7c commit 78c24a0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ public CompletableFuture<TransactionMeta> getTransactionMeta(TxnID txnID) {
232232
return CompletableFuture.completedFuture(null);
233233
}
234234

235+
@VisibleForTesting
236+
public void setPublishFuture(CompletableFuture<Position> publishFuture) {
237+
this.publishFuture = publishFuture;
238+
}
239+
235240
@VisibleForTesting
236241
public CompletableFuture<Position> getPublishFuture() {
237242
return publishFuture;
@@ -298,7 +303,7 @@ public CompletableFuture<Position> appendBufferToTxn(TxnID txnId, long sequenceI
298303
"Transaction Buffer recover failed, the current state is: " + getState()));
299304
}
300305
}).whenComplete(((position, throwable) -> buffer.release()));
301-
publishFuture = future;
306+
setPublishFuture(future);
302307
return future;
303308
}
304309

0 commit comments

Comments
 (0)