Skip to content

Commit 31efbc0

Browse files
committed
HBASE-29700 Always close RPC servers in AbstractTestIPC (#7435)
(cherry picked from commit 5fb9066) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 4ac5b6d)
1 parent 87b93cd commit 31efbc0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,8 @@ public void testTracingSuccessIpc() throws IOException, ServiceException {
581581
everyItem(allOf(hasStatusWithCode(StatusCode.OK),
582582
hasTraceId(traceRule.getSpans().iterator().next().getTraceId()),
583583
hasDuration(greaterThanOrEqualTo(Duration.ofMillis(100L))))));
584+
} finally {
585+
rpcServer.stop();
584586
}
585587
}
586588

@@ -609,6 +611,8 @@ public void testTracingErrorIpc() throws IOException {
609611
assertFalse("no spans provided", traceRule.getSpans().isEmpty());
610612
assertThat(traceRule.getSpans(), everyItem(allOf(hasStatusWithCode(StatusCode.ERROR),
611613
hasTraceId(traceRule.getSpans().iterator().next().getTraceId()))));
614+
} finally {
615+
rpcServer.stop();
612616
}
613617
}
614618

@@ -670,6 +674,8 @@ public void testGetConnectionRegistry() throws IOException, ServiceException {
670674
GetConnectionRegistryResponse resp =
671675
stub.getConnectionRegistry(null, GetConnectionRegistryRequest.getDefaultInstance());
672676
assertEquals(clusterId, resp.getClusterId());
677+
} finally {
678+
rpcServer.stop();
673679
}
674680
}
675681

@@ -701,6 +707,8 @@ public void testGetConnectionRegistryError() throws IOException, ServiceExceptio
701707
assertEquals(FatalConnectionException.class.getName(),
702708
((RemoteException) pcrc.getFailed()).getClassName());
703709
assertThat(pcrc.getFailed().getMessage(), startsWith("Expected HEADER="));
710+
} finally {
711+
rpcServer.stop();
704712
}
705713
}
706714
}

0 commit comments

Comments
 (0)