|
69 | 69 | import org.opensearch.repositories.s3.async.AsyncTransferManager;
|
70 | 70 | import org.opensearch.repositories.s3.async.SizeBasedBlockingQ;
|
71 | 71 | import org.opensearch.repositories.s3.async.TransferSemaphoresHolder;
|
| 72 | +import org.opensearch.threadpool.ThreadPool; |
72 | 73 | import org.junit.After;
|
73 | 74 | import org.junit.Assert;
|
74 | 75 | import org.junit.Before;
|
|
94 | 95 | import java.util.concurrent.TimeUnit;
|
95 | 96 | import java.util.concurrent.atomic.AtomicInteger;
|
96 | 97 | import java.util.concurrent.atomic.AtomicReference;
|
| 98 | +import java.util.stream.Stream; |
97 | 99 |
|
98 | 100 | import static org.opensearch.repositories.s3.S3ClientSettings.DISABLE_CHUNKED_ENCODING;
|
99 | 101 | import static org.opensearch.repositories.s3.S3ClientSettings.ENDPOINT_SETTING;
|
@@ -162,14 +164,10 @@ public void setUp() throws Exception {
|
162 | 164 | @After
|
163 | 165 | public void tearDown() throws Exception {
|
164 | 166 | IOUtils.close(service, asyncService);
|
165 |
| - |
166 |
| - streamReaderService.shutdown(); |
167 |
| - futureCompletionService.shutdown(); |
168 |
| - remoteTransferRetry.shutdown(); |
169 |
| - transferQueueConsumerService.shutdown(); |
170 |
| - scheduler.shutdown(); |
171 | 167 | normalPrioritySizeBasedBlockingQ.close();
|
172 | 168 | lowPrioritySizeBasedBlockingQ.close();
|
| 169 | + Stream.of(streamReaderService, futureCompletionService, remoteTransferRetry, transferQueueConsumerService, scheduler) |
| 170 | + .forEach(e -> assertTrue(ThreadPool.terminate(e, 5, TimeUnit.SECONDS))); |
173 | 171 | IOUtils.close(transferNIOGroup);
|
174 | 172 |
|
175 | 173 | if (previousOpenSearchPathConf != null) {
|
|
0 commit comments