Copilot commented on code in PR #2749:
URL: https://github.com/apache/tika/pull/2749#discussion_r3044317046


##########
tika-grpc/src/test/java/org/apache/tika/pipes/grpc/TikaGrpcServerTest.java:
##########
@@ -306,6 +307,10 @@ public void onCompleted() {
             assertEquals(NUM_TEST_DOCS, successes.size());
             assertEquals(1, errors.size());
             assertTrue(finished.get());
+
+            tikaGrpcServerImpl.shutdown();
+            server.shutdown();
+            tikaGrpcServerImpl.postShutdown();

Review Comment:
   The explicit cleanup (tikaGrpcServerImpl.shutdown()/postShutdown() and 
server.shutdown()) is inside the main try block, so if any assertion (or 
earlier exception) fails these calls won’t run and the 
PipesClient/PerClientServerManager temp directory can still be left behind. 
Move this cleanup into a finally (or register a Closeable with the test 
Resources) and ensure the gRPC Server is fully terminated (e.g., 
awaitTermination with a timeout) before calling postShutdown (its javadoc says 
it must be after the server has shut down). Also consider applying the same 
shutdown/postShutdown pattern to testFetcherCrud(), which currently 
instantiates TikaGrpcServerImpl inline and never closes it.



-- 
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]

Reply via email to