yifan-c commented on code in PR #1706:
URL: https://github.com/apache/cassandra/pull/1706#discussion_r1110216521
##########
test/distributed/org/apache/cassandra/distributed/test/InternodeEncryptionEnforcementTest.java:
##########
@@ -134,19 +125,14 @@ public void
testOutboundConnectionsAreRejectedWhenAuthFails() throws IOException
public void testOutboundConnectionsAreInterruptedWhenAuthFails() throws
IOException, TimeoutException
{
Cluster.Builder builder =
createCluster(AllowFirstAndRejectOtherOutboundAuthenticator.class);
+ final ExecutorService executorService =
Executors.newSingleThreadExecutor();
+
try (Cluster cluster = builder.start())
Review Comment:
nit: it is safer to close the `ExecutorService` along with `cluster`.
Otherwise, if the body of `try` throws, only `cluster` is closed, but
`executorService.shutdown()` will not be called.
You can have multiple `closable`s in the try-with-resources statement, and
remove `executorService.shutdown()` at the end of the test.
```
try (Cluster cluster = builder.start(); Closeable es =
executorService::shutdown)
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]