Skip to content

Commit 177caa5

Browse files
zustonjerqi
authored andcommitted
[ISSUE-244] Fix flaky test of CoordinatorGrpcTest.rpcMetricsTest (#256)
### What changes were proposed in this pull request? [ISSUE-244] Fix flaky test of CoordinatorGrpcTest.rpcMetricsTest ### Why are the changes needed? 1. The gauge metric of `HEARTBEAT_METHOD` is hard to meansure due to async sending at background. So remove it 2. The gauge metric of `GET_SHUFFLE_ASSIGNMENTS_METHOD` may be not called `descCounter` when rpc finished, so remove it ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Dont need
1 parent 7088e5f commit 177caa5

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

integration-test/common/src/test/java/org/apache/uniffle/test/CoordinatorGrpcTest.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,10 @@ public void shuffleServerHeartbeatTest() throws Exception {
245245
public void rpcMetricsTest() throws Exception {
246246
double oldValue = coordinators.get(0).getGrpcMetrics().getCounterMap()
247247
.get(CoordinatorGrpcMetrics.HEARTBEAT_METHOD).get();
248-
CoordinatorTestUtils.waitForRegister(coordinatorClient,2);
248+
CoordinatorTestUtils.waitForRegister(coordinatorClient, 2);
249249
double newValue = coordinators.get(0).getGrpcMetrics().getCounterMap()
250250
.get(CoordinatorGrpcMetrics.HEARTBEAT_METHOD).get();
251251
assertTrue(newValue - oldValue > 1);
252-
assertEquals(0,
253-
coordinators.get(0).getGrpcMetrics().getGaugeMap()
254-
.get(CoordinatorGrpcMetrics.HEARTBEAT_METHOD).get(), 0.5);
255252

256253
String appId = "rpcMetricsTest";
257254
RssGetShuffleAssignmentsRequest request = new RssGetShuffleAssignmentsRequest(
@@ -263,9 +260,6 @@ public void rpcMetricsTest() throws Exception {
263260
newValue = coordinators.get(0).getGrpcMetrics().getCounterMap()
264261
.get(CoordinatorGrpcMetrics.GET_SHUFFLE_ASSIGNMENTS_METHOD).get();
265262
assertEquals(oldValue + 1, newValue, 0.5);
266-
assertEquals(0,
267-
coordinators.get(0).getGrpcMetrics().getGaugeMap()
268-
.get(CoordinatorGrpcMetrics.GET_SHUFFLE_ASSIGNMENTS_METHOD).get(), 0.5);
269263

270264
double connectionSize = coordinators.get(0)
271265
.getGrpcMetrics().getGaugeMap().get(GRCP_SERVER_CONNECTION_NUMBER_KEY).get();

0 commit comments

Comments
 (0)