Skip to content

Commit 3b46de8

Browse files
authored
[TIKA-4704] clean up to avoid remaining temp directory (#2749)
1 parent 6d9a61e commit 3b46de8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tika-grpc/src/test/java/org/apache/tika/pipes/grpc/TikaGrpcServerTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,11 @@ private static String createFetcherId(int i) {
205205
public void testBiStream(Resources resources) throws Exception {
206206
String serverName = InProcessServerBuilder.generateName();
207207

208+
TikaGrpcServerImpl tikaGrpcServerImpl = new TikaGrpcServerImpl(tikaConfig.toAbsolutePath().toString());
208209
Server server = InProcessServerBuilder
209210
.forName(serverName)
210211
.directExecutor()
211-
.addService(new TikaGrpcServerImpl(tikaConfig.toAbsolutePath().toString()))
212+
.addService(tikaGrpcServerImpl)
212213
.build()
213214
.start();
214215
resources.register(server, Duration.ofSeconds(10));
@@ -306,6 +307,10 @@ public void onCompleted() {
306307
assertEquals(NUM_TEST_DOCS, successes.size());
307308
assertEquals(1, errors.size());
308309
assertTrue(finished.get());
310+
311+
tikaGrpcServerImpl.shutdown();
312+
server.shutdown();
313+
tikaGrpcServerImpl.postShutdown();
309314
} finally {
310315
FileUtils.deleteDirectory(testDocumentFolder);
311316
}

0 commit comments

Comments
 (0)