Skip to content

Commit

Permalink
[ISSUE-244] Fix flaky test of CoordinatorGrpcTest.rpcMetricsTest (#256)
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
zuston authored and jerqi committed Oct 12, 2022
1 parent 7088e5f commit 177caa5
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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();
Expand Down

0 comments on commit 177caa5

Please sign in to comment.