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

RongtongJin pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new e90303810a fix(test): stabilize client offline receipt handle test 
(#10996)
e90303810a is described below

commit e90303810a14ae292f45d41dae5cb832ec676be8
Author: 烤化の初雪 <[email protected]>
AuthorDate: Thu Sep 3 10:21:24 2026 +0800

    fix(test): stabilize client offline receipt handle test (#10996)
    
    Signed-off-by: unbridled-41 <[email protected]>
---
 .../service/receipt/DefaultReceiptHandleManagerTest.java    | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/proxy/src/test/java/org/apache/rocketmq/proxy/service/receipt/DefaultReceiptHandleManagerTest.java
 
b/proxy/src/test/java/org/apache/rocketmq/proxy/service/receipt/DefaultReceiptHandleManagerTest.java
index a01c356f77..961d68951e 100644
--- 
a/proxy/src/test/java/org/apache/rocketmq/proxy/service/receipt/DefaultReceiptHandleManagerTest.java
+++ 
b/proxy/src/test/java/org/apache/rocketmq/proxy/service/receipt/DefaultReceiptHandleManagerTest.java
@@ -460,7 +460,16 @@ public class DefaultReceiptHandleManagerTest extends 
BaseServiceTest {
         Mockito.verify(consumerManager, 
Mockito.times(1)).appendConsumerIdsChangeListener(listenerArgumentCaptor.capture());
         Channel channel = PROXY_CONTEXT.getVal(ContextVariable.CHANNEL);
         receiptHandleManager.addReceiptHandle(PROXY_CONTEXT, channel, GROUP, 
MSG_ID, messageReceiptHandle);
+        
Mockito.when(messagingProcessor.changeInvisibleTime(Mockito.any(ProxyContext.class),
 Mockito.any(ReceiptHandle.class),
+                Mockito.eq(MESSAGE_ID), Mockito.eq(GROUP), Mockito.eq(TOPIC),
+                
Mockito.eq(ConfigurationManager.getProxyConfig().getInvisibleTimeMillisWhenClear())))
+            .thenReturn(CompletableFuture.completedFuture(new AckResult()));
         
listenerArgumentCaptor.getValue().handle(ConsumerGroupEvent.CLIENT_UNREGISTER, 
GROUP, new ClientChannelInfo(channel, "", LanguageCode.JAVA, 0));
-        assertTrue(receiptHandleManager.receiptHandleGroupMap.isEmpty());
+        await().atMost(Duration.ofSeconds(1)).untilAsserted(() -> {
+            Mockito.verify(messagingProcessor, Mockito.times(1))
+                .changeInvisibleTime(Mockito.any(ProxyContext.class), 
Mockito.any(ReceiptHandle.class), Mockito.eq(MESSAGE_ID),
+                    Mockito.eq(GROUP), Mockito.eq(TOPIC), 
Mockito.eq(ConfigurationManager.getProxyConfig().getInvisibleTimeMillisWhenClear()));
+            assertTrue(receiptHandleManager.receiptHandleGroupMap.isEmpty());
+        });
     }
-}
\ No newline at end of file
+}

Reply via email to