mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
test(apigateway): await authorizer cleanup tasks (#4261)
Use try-with-resources for the two authorizer test cleanup executors so close() waits for every submitted delete, including when an earlier Future.get fails. Closes #3999
This commit is contained in:
1 parent
fab5130ebb
commit
ed627a6ce7
2 files changed
+2
-8
No files matched your search
+1
-4
@@ -1033,8 +1033,7 @@ class ApiGatewayRequestAuthorizerIntegrationTest {
|
||||
}
|
||||
|
||||
private static void deleteFunctions(String... functionNames) throws Exception {
|
||||
ExecutorService executor = Executors.newFixedThreadPool(functionNames.length);
|
||||
try {
|
||||
try (ExecutorService executor = Executors.newFixedThreadPool(functionNames.length)) {
|
||||
List<Future<?>> deletions = new ArrayList<>();
|
||||
for (String functionName : functionNames) {
|
||||
deletions.add(executor.submit(() -> deleteFunction(functionName)));
|
||||
@@ -1042,8 +1041,6 @@ class ApiGatewayRequestAuthorizerIntegrationTest {
|
||||
for (Future<?> deletion : deletions) {
|
||||
deletion.get();
|
||||
}
|
||||
} finally {
|
||||
executor.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -746,8 +746,7 @@ class HttpApiRequestAuthorizerTest {
|
||||
}
|
||||
|
||||
private static void deleteFunctions(String... functionNames) throws Exception {
|
||||
ExecutorService executor = Executors.newFixedThreadPool(functionNames.length);
|
||||
try {
|
||||
try (ExecutorService executor = Executors.newFixedThreadPool(functionNames.length)) {
|
||||
List<Future<?>> deletions = new ArrayList<>();
|
||||
for (String functionName : functionNames) {
|
||||
deletions.add(executor.submit(() -> deleteFunction(functionName)));
|
||||
@@ -755,8 +754,6 @@ class HttpApiRequestAuthorizerTest {
|
||||
for (Future<?> deletion : deletions) {
|
||||
deletion.get();
|
||||
}
|
||||
} finally {
|
||||
executor.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user