From 177caa50a425a8d816590fd16e3d3a4add50bfdb Mon Sep 17 00:00:00 2001 From: Junfan Zhang Date: Tue, 11 Oct 2022 11:59:13 +0800 Subject: [PATCH] [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 --- .../java/org/apache/uniffle/test/CoordinatorGrpcTest.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/integration-test/common/src/test/java/org/apache/uniffle/test/CoordinatorGrpcTest.java b/integration-test/common/src/test/java/org/apache/uniffle/test/CoordinatorGrpcTest.java index c09067eae4..3cc7963227 100644 --- a/integration-test/common/src/test/java/org/apache/uniffle/test/CoordinatorGrpcTest.java +++ b/integration-test/common/src/test/java/org/apache/uniffle/test/CoordinatorGrpcTest.java @@ -245,13 +245,10 @@ public void shuffleServerHeartbeatTest() throws Exception { public void rpcMetricsTest() throws Exception { double oldValue = coordinators.get(0).getGrpcMetrics().getCounterMap() .get(CoordinatorGrpcMetrics.HEARTBEAT_METHOD).get(); - CoordinatorTestUtils.waitForRegister(coordinatorClient,2); + CoordinatorTestUtils.waitForRegister(coordinatorClient, 2); double newValue = coordinators.get(0).getGrpcMetrics().getCounterMap() .get(CoordinatorGrpcMetrics.HEARTBEAT_METHOD).get(); assertTrue(newValue - oldValue > 1); - assertEquals(0, - coordinators.get(0).getGrpcMetrics().getGaugeMap() - .get(CoordinatorGrpcMetrics.HEARTBEAT_METHOD).get(), 0.5); String appId = "rpcMetricsTest"; RssGetShuffleAssignmentsRequest request = new RssGetShuffleAssignmentsRequest( @@ -263,9 +260,6 @@ public void rpcMetricsTest() throws Exception { newValue = coordinators.get(0).getGrpcMetrics().getCounterMap() .get(CoordinatorGrpcMetrics.GET_SHUFFLE_ASSIGNMENTS_METHOD).get(); assertEquals(oldValue + 1, newValue, 0.5); - assertEquals(0, - coordinators.get(0).getGrpcMetrics().getGaugeMap() - .get(CoordinatorGrpcMetrics.GET_SHUFFLE_ASSIGNMENTS_METHOD).get(), 0.5); double connectionSize = coordinators.get(0) .getGrpcMetrics().getGaugeMap().get(GRCP_SERVER_CONNECTION_NUMBER_KEY).get();