This is an automated email from the ASF dual-hosted git repository.
gavinchou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new fd4af918815 [fix](feut) fix flakey MetaServiceProxyTest (#66219)
fd4af918815 is described below
commit fd4af918815c1f657213a6f678fad5aa8b9d6603
Author: meiyi <[email protected]>
AuthorDate: Tue Aug 18 03:04:55 2026 +0800
[fix](feut) fix flakey MetaServiceProxyTest (#66219)
---
.../apache/doris/cloud/rpc/MetaServiceProxyTest.java | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/cloud/rpc/MetaServiceProxyTest.java
b/fe/fe-core/src/test/java/org/apache/doris/cloud/rpc/MetaServiceProxyTest.java
index a9f25586bee..e5084575a4b 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/cloud/rpc/MetaServiceProxyTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/cloud/rpc/MetaServiceProxyTest.java
@@ -22,6 +22,7 @@ import org.apache.doris.common.Config;
import org.apache.doris.common.jmockit.Deencapsulation;
import org.apache.doris.rpc.RpcException;
+import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.SettableFuture;
import com.google.protobuf.DescriptorProtos;
import com.google.protobuf.Descriptors;
@@ -474,11 +475,18 @@ public class MetaServiceProxyTest {
@Test
public void testGetVisibleVersionAsyncRateLimitedBeforeRpc() throws
RpcException {
- enableRateLimit(1, "", 1, 0);
+ // Consume limitForPeriod = qpsPerCore * CPU_CORES * burstSeconds in
one weighted request.
+ // A long burst window also prevents a refresh before the assertion if
the scheduler stalls.
+ int qpsPerCore = 1;
+ int rateLimitBurstSeconds = 60;
+ int limitForPeriod = qpsPerCore * CPU_CORES * rateLimitBurstSeconds;
+ enableRateLimit(qpsPerCore, "", rateLimitBurstSeconds, 0);
MetaServiceProxy proxy = new MetaServiceProxy();
MetaServiceClient client = mockNormalClient();
putClient(proxy, client);
- consumeRateLimitPermits(proxy, "getPartitionVersion");
+ Mockito.when(client.getVisibleVersionAsync(Mockito.any()))
+ .thenReturn(Futures.immediateFuture(okGetVersionResponse()));
+
proxy.getVisibleVersionAsync(buildBatchPartitionVersionRequest(limitForPeriod));
try {
proxy.getVisibleVersionAsync(Cloud.GetVersionRequest.newBuilder().build());
@@ -487,7 +495,7 @@ public class MetaServiceProxyTest {
Assert.assertTrue(e.getMessage().contains("meta service rpc rate
limited"));
}
- Mockito.verify(client,
Mockito.never()).getVisibleVersionAsync(Mockito.any());
+ Mockito.verify(client,
Mockito.times(1)).getVisibleVersionAsync(Mockito.any());
Mockito.verify(client, Mockito.never()).shutdown(Mockito.anyBoolean());
}
@@ -497,8 +505,8 @@ public class MetaServiceProxyTest {
MetaServiceProxy proxy = new MetaServiceProxy();
MetaServiceClient client = mockNormalClient();
putClient(proxy, client);
- SettableFuture<Cloud.GetVersionResponse> future =
SettableFuture.create();
-
Mockito.when(client.getVisibleVersionAsync(Mockito.any())).thenReturn(future);
+ Mockito.when(client.getVisibleVersionAsync(Mockito.any()))
+ .thenReturn(Futures.immediateFuture(okGetVersionResponse()));
proxy.getVisibleVersionAsync(buildBatchTableVersionRequest(CPU_CORES));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]