shutdown executorService in benchmark after each
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package performance;
|
package performance;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -51,6 +52,11 @@ public class PerformanceTest {
|
|||||||
executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterEach
|
||||||
|
void tearDown() {
|
||||||
|
executorService.shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void plainPerformanceTest() throws Exception {
|
void plainPerformanceTest() throws Exception {
|
||||||
var orders = benchmark(numTraders, numOrders, pairs, PlainCurrencyExchange::new, null, false);
|
var orders = benchmark(numTraders, numOrders, pairs, PlainCurrencyExchange::new, null, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user