Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit bebd9c3

Browse files
knutwalkerjexp
authored andcommitted
Try to be more aggressive when shutting the test pool down (#434)
Test failures on travis often happen when the pool did not shutdown in time and the test frameworks complains about leaked threads. Try to wait for task termination first before returning control to the test framework.
1 parent c3ec2d4 commit bebd9c3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/src/test/java/org/neo4j/graphalgo/core/utils/ParallelUtilTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,15 @@ private static void withPool(
269269
} catch (Throwable throwable) {
270270
throw Exceptions.launderedException(throwable);
271271
} finally {
272+
List<Runnable> unscheduled = pool.shutdownNow();
273+
pool.shutdown();
274+
try {
275+
pool.awaitTermination(1, TimeUnit.MINUTES);
276+
} catch (InterruptedException e) {
277+
// ok
278+
}
272279
assertTrue(pool.shutdownNow().isEmpty());
280+
assertTrue(pool.isTerminated());
273281
}
274282
}
275283

0 commit comments

Comments
 (0)