ctubbsii commented on a change in pull request #2333:
URL: https://github.com/apache/accumulo/pull/2333#discussion_r739330977
##########
File path:
test/src/main/java/org/apache/accumulo/test/functional/ManagerApiIT.java
##########
@@ -210,12 +210,19 @@ public void testPermissions_shutdownTabletServer() throws
Exception {
// see the junit annotation to control test ordering at the top of this class
@Test
public void z99_testPermissions_shutdown() throws Exception {
+ // grab connections before shutting down
+ AccumuloClient rootUserClient = Accumulo.newClient().from(getClientProps())
+ .as(rootUser.getPrincipal(), rootUser.getToken()).build();
+ AccumuloClient privilegedUserClient =
Accumulo.newClient().from(getClientProps())
+ .as(privilegedUser.getPrincipal(), privilegedUser.getToken()).build();
// To shutdown, user needs SystemPermission.SYSTEM
op = user -> client -> client.shutdown(null, user, false);
expectPermissionDenied(op, regularUser);
// We should be able to do both of the following RPC calls before it
actually shuts down
- expectPermissionSuccess(op, rootUser);
- expectPermissionSuccess(op, privilegedUser);
+ expectPermissionSuccess(op, (ClientContext) rootUserClient);
+ expectPermissionSuccess(op, (ClientContext) privilegedUserClient);
+ rootUserClient.close();
+ privilegedUserClient.close();
Review comment:
These clients should be in try-with-resources blocks, rather than have
explicit calls to `close()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]