diff --git a/fireflies/src/test/java/com/salesforce/apollo/fireflies/ChurnTest.java b/fireflies/src/test/java/com/salesforce/apollo/fireflies/ChurnTest.java index fab24a1bd..331da49b3 100644 --- a/fireflies/src/test/java/com/salesforce/apollo/fireflies/ChurnTest.java +++ b/fireflies/src/test/java/com/salesforce/apollo/fireflies/ChurnTest.java @@ -54,6 +54,7 @@ public class ChurnTest { private MetricRegistry registry; private List views; private ExecutorService executor; + private ExecutorService executor2; @BeforeAll public static void beforeClass() throws Exception { @@ -84,6 +85,9 @@ public void after() { if (executor != null) { executor.shutdown(); } + if (executor2 != null) { + executor2.shutdown(); + } } @Test @@ -266,6 +270,7 @@ public void churn() throws Exception { private void initialize() { executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); + executor2 = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); var parameters = Parameters.newBuilder().setMaximumTxfr(20).build(); registry = new MetricRegistry(); node0Registry = new MetricRegistry(); @@ -296,7 +301,7 @@ private void initialize() { new ServerConnectionCacheMetricsImpl( frist.getAndSet(false) ? node0Registry : registry)), - executor); + executor2); comms.start(); communications.add(comms); diff --git a/fireflies/src/test/java/com/salesforce/apollo/fireflies/SwarmTest.java b/fireflies/src/test/java/com/salesforce/apollo/fireflies/SwarmTest.java index 632cc0613..2746534ce 100644 --- a/fireflies/src/test/java/com/salesforce/apollo/fireflies/SwarmTest.java +++ b/fireflies/src/test/java/com/salesforce/apollo/fireflies/SwarmTest.java @@ -64,6 +64,7 @@ public class SwarmTest { private MetricRegistry registry; private List views; private ExecutorService executor; + private ExecutorService executor2; @BeforeAll public static void beforeClass() throws Exception { @@ -94,6 +95,9 @@ public void after() { if (executor != null) { executor.shutdown(); } + if (executor2 != null) { + executor2.shutdown(); + } } @Test @@ -210,6 +214,7 @@ public void swarm() throws Exception { private void initialize() { executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); + executor2 = UnsafeExecutors.newVirtualThreadPerTaskExecutor(); var parameters = Parameters.newBuilder() .setMaxPending(50) .setMaximumTxfr(20) @@ -249,7 +254,7 @@ private void initialize() { new ServerConnectionCacheMetricsImpl( frist.getAndSet(false) ? node0Registry : registry)), - executor); + executor2); comms.start(); communications.add(comms);