Skip to content

Commit

Permalink
Consolidate cleanup for Azure blob tests (#16789) (#16811)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2d18c34)

Signed-off-by: Andriy Redko <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent aac4041 commit 9ed0b86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@

import fixture.azure.AzureHttpHandler;
import reactor.core.scheduler.Schedulers;
import reactor.netty.http.HttpResources;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.opensearch.repositories.azure.AzureRepository.Repository.CONTAINER_SETTING;
Expand Down Expand Up @@ -143,6 +144,7 @@ public void tearDown() throws Exception {

@AfterClass
public static void shutdownSchedulers() {
HttpResources.disposeLoopsAndConnections();
Schedulers.shutdownNow();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import java.util.List;

import reactor.core.scheduler.Schedulers;
import reactor.netty.http.HttpResources;

import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
Expand All @@ -57,6 +58,7 @@
public class AzureRepositorySettingsTests extends OpenSearchTestCase {
@AfterClass
public static void shutdownSchedulers() {
HttpResources.disposeLoopsAndConnections();
Schedulers.shutdownNow();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.opensearch.common.unit.TimeValue;
import org.opensearch.core.common.Strings;
import org.opensearch.test.OpenSearchTestCase;
import org.junit.After;
import org.junit.AfterClass;

import java.io.IOException;
Expand Down Expand Up @@ -71,19 +70,10 @@
public class AzureStorageServiceTests extends OpenSearchTestCase {
@AfterClass
public static void shutdownSchedulers() {
HttpResources.disposeLoopsAndConnections();
Schedulers.shutdownNow();
}

@After
public void tearDown() throws Exception {
try {
// Properly shut down resources
HttpResources.disposeLoopsAndConnectionsLater().block();
} finally {
super.tearDown();
}
}

public void testReadSecuredSettings() {
final Settings settings = Settings.builder()
.setSecureSettings(buildSecureSettings())
Expand Down

0 comments on commit 9ed0b86

Please sign in to comment.