From a93a07475e646faff10e26571c96a53c9b99eb22 Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Sun, 1 Nov 2026 09:39:43 -0600 Subject: [PATCH] chore(compat): run sdk-test-java classes in parallel and pre-pull service images (#7212) * chore(compat): run sdk-test-java classes in parallel and pre-pull service images The sdk-test-java leg has grown to ~18 min because the suite runs strictly serially and most of its time is spent waiting on containers Floci starts and on minute-aligned metric ticks. Run test classes three at a time (the methods of a class stay on one thread, in order), with @ResourceLock on the classes that change Organizations or SES account-level state and @Isolated on the ones that change wider shared state. Also pull the heavy service images in the background before the tests start, so they no longer serialize inside the test window, and drop the stale "~10 min" note from the timing-report comment. On the homelab runner (x86, 6 vCPU, JVM Floci with CI's flags) the suite went from 21.5 to 10.7 min with the same 2933 tests and no new failures. Signed-off-by: Hector Ventura * chore(compat): lock the classes that share port 5432 and floci-duck The first CI run in parallel failed three tests. RdsControlPlaneTest's DB proxy could not bind port 5432 while DsqlCompatTest's endpoint held it, so the two now share a lock. DataLakeTest's Athena query failed in floci-duck while RedshiftRelationalSpectrumTest was using it; the classes that drive floci-duck now share a lock too. EcrTest deleted its last repository and the next CreateRepository stalled for 30 s, past the SDK's timeout, while Floci kept calling the removed registry's cached address. The retry then got RepositoryAlreadyExists. The class now keeps one repository for its whole run, so the registry stays up. Signed-off-by: Hector Ventura --------- Signed-off-by: Hector Ventura --- .github/workflows/compatibility.yml | 25 +++++++++++++++++-- .../src/test/java/com/floci/test/AcmTest.java | 2 ++ .../test/java/com/floci/test/AthenaTest.java | 2 ++ .../java/com/floci/test/CloudTrailTest.java | 2 ++ .../CloudWatchLogsCrossAccountPolicyTest.java | 2 ++ .../java/com/floci/test/DataLakeTest.java | 2 ++ ...tectiveOrganizationAdministrationTest.java | 2 ++ .../java/com/floci/test/DsqlCompatTest.java | 2 ++ .../src/test/java/com/floci/test/EcrTest.java | 8 ++++++ .../test/java/com/floci/test/EcsTests.java | 2 ++ .../FirehoseDataFormatConversionTest.java | 2 ++ .../test/FirehoseParquetDeliveryTest.java | 2 ++ .../java/com/floci/test/GuardDutyTest.java | 2 ++ .../src/test/java/com/floci/test/IamTest.java | 2 ++ ...spector2OrganizationConfigurationTest.java | 2 ++ .../MacieOrganizationAdministrationTest.java | 2 ++ .../com/floci/test/OrganizationsTest.java | 2 ++ .../test/RamOrganizationSharingTest.java | 2 ++ .../com/floci/test/RdsControlPlaneTest.java | 2 ++ .../java/com/floci/test/S3ControlTest.java | 2 ++ .../java/com/floci/test/S3SelectTest.java | 2 ++ ...urityHubOrganizationConfigurationTest.java | 2 ++ .../floci/test/SesAccountAttributesTest.java | 2 ++ .../floci/test/SesBatchGetMetricDataTest.java | 2 ++ .../floci/test/SesDedicatedIpPoolTest.java | 2 ++ .../java/com/floci/test/SesExportJobTest.java | 2 ++ .../floci/test/SesMessageInsightsTest.java | 2 ++ .../com/floci/test/SesReceiptRuleSetTest.java | 2 ++ .../com/floci/test/SesRecommendationTest.java | 2 ++ .../RedshiftRelationalSpectrumTest.java | 2 ++ .../floci/compat/RedshiftSpectrumTest.java | 2 ++ .../test/resources/junit-platform.properties | 10 ++++++++ 32 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 compatibility-tests/sdk-test-java/src/test/resources/junit-platform.properties diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 0b2214299a..2ec65b12d6 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -327,6 +327,27 @@ jobs: - name: Load native floci image run: gunzip -c /tmp/floci-native-image.tar.gz | docker load + # The suite makes Floci pull ~30 images on a fresh runner, about 2 minutes inside the test + # window. Pulling the heavy ones in the background here overlaps them with Floci's start, the + # checkout and the test image build; a pull still running when a test needs the image is joined + # by the daemon, not repeated. The list follows the "Pulling image:" lines of Floci's log; a + # stale entry only costs a wasted pull, a missing one only the time it costs today. + - name: Pre-pull service images + if: matrix.test == 'sdk-test-java' + run: | + for image in \ + opensearchproject/opensearch:2.19.5 opensearchproject/opensearch:2.11.1 \ + mysql:8.0 postgres:16.3-alpine postgres:16-alpine postgres:15-alpine \ + apache/flink:2.3 rabbitmq:3-management redpandadata/redpanda:latest \ + tinkerpop/gremlin-server:3.7.3 influxdb:2.7 valkey/valkey:8 \ + rancher/k3s:latest rancher/k3s:v1.29.14-k3s1 registry:2 \ + public.ecr.aws/lambda/python:3.12 public.ecr.aws/lambda/python:3.14 \ + public.ecr.aws/lambda/nodejs:20 public.ecr.aws/lambda/provided:al2023 \ + floci/floci-duck:latest floci/floci-sidecar-cedar:1.1.0 floci/floci-sidecar-graphql:0.2.0 \ + nginx:alpine nginx:latest alpine:3 alpine:latest busybox:stable busybox:latest; do + nohup docker pull -q "$image" > /dev/null 2>&1 & + done + - name: Create Docker network run: docker network create compat-net @@ -435,8 +456,8 @@ jobs: paths: test-results/*.xml # The test body inside the container runs its build tool quietly, so the - # job log carries no per-class timings and the slow legs (sdk-test-java, - # ~10 min) are a black box. Surface the timings from the junit XMLs the + # job log carries no per-class timings and the slow legs (sdk-test-java) + # are a black box. Surface the timings from the junit XMLs the # suites already export, and upload the raw XMLs so the numbers are # machine-readable across runs. - name: Report slowest test classes diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AcmTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AcmTest.java index 2210b944f8..fd12526d4a 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AcmTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AcmTest.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.Isolated; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy; import software.amazon.awssdk.core.waiters.WaiterResponse; @@ -29,6 +30,7 @@ import static org.assertj.core.api.Assertions.*; @DisplayName("ACM Certificate Manager") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@Isolated class AcmTest { private static AcmClient acm; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AthenaTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AthenaTest.java index e420903ec6..80d1bf320f 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AthenaTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AthenaTest.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.services.athena.AthenaClient; import software.amazon.awssdk.services.athena.model.*; @@ -17,6 +18,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; @DisplayName("Athena Query Execution") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("floci-duck") class AthenaTest { private static AthenaClient athena; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CloudTrailTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CloudTrailTest.java index 002c0d8c15..c9683e2c5d 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CloudTrailTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CloudTrailTest.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.Isolated; import software.amazon.awssdk.services.cloudtrail.CloudTrailClient; import software.amazon.awssdk.services.cloudtrail.model.CreateTrailResponse; import software.amazon.awssdk.services.cloudtrail.model.DescribeTrailsResponse; @@ -14,6 +15,7 @@ import static org.junit.jupiter.api.Assumptions.assumeFalse; @DisplayName("CloudTrail") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@Isolated class CloudTrailTest { private static CloudTrailClient cloudTrail; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CloudWatchLogsCrossAccountPolicyTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CloudWatchLogsCrossAccountPolicyTest.java index dd8b936d0f..3a9353fb67 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CloudWatchLogsCrossAccountPolicyTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CloudWatchLogsCrossAccountPolicyTest.java @@ -2,6 +2,7 @@ package com.floci.test; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Isolated; import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsClient; import software.amazon.awssdk.services.cloudwatchlogs.model.DescribeAccountPoliciesResponse; import software.amazon.awssdk.services.cloudwatchlogs.model.InvalidParameterException; @@ -14,6 +15,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assumptions.assumeFalse; @DisplayName("CloudWatch Logs cross-account management APIs") +@Isolated class CloudWatchLogsCrossAccountPolicyTest { private static final String DESTINATION_NAME = "floci-sdk-cross-account-destination"; private static final String POLICY_NAME = "floci-sdk-cross-account-transformer"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DataLakeTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DataLakeTest.java index 3632eb3af2..735e0e3367 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DataLakeTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DataLakeTest.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.services.athena.AthenaClient; import software.amazon.awssdk.services.athena.model.*; @@ -27,6 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; @DisplayName("Data Lake (Athena + Glue + Firehose)") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("floci-duck") class DataLakeTest { private static AthenaClient athena; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DetectiveOrganizationAdministrationTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DetectiveOrganizationAdministrationTest.java index aa55db99a8..3ed99276e4 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DetectiveOrganizationAdministrationTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DetectiveOrganizationAdministrationTest.java @@ -2,6 +2,7 @@ package com.floci.test; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.detective.DetectiveClient; import software.amazon.awssdk.services.detective.model.Account; import software.amazon.awssdk.services.detective.model.CreateMembersResponse; @@ -14,6 +15,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; @DisplayName("Detective organization administration") +@ResourceLock("organizations") class DetectiveOrganizationAdministrationTest { private static final String MANAGEMENT_ACCOUNT = "222222222222"; private static final String ADMIN_ACCOUNT = MANAGEMENT_ACCOUNT; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DsqlCompatTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DsqlCompatTest.java index b48110ffdc..f2727d3661 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DsqlCompatTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DsqlCompatTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.dsql.DsqlClient; import software.amazon.awssdk.services.dsql.model.ClusterStatus; @@ -44,6 +45,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; */ @DisplayName("Aurora DSQL") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("port-5432") class DsqlCompatTest { private static final Region REGION = TestFixtures.region(); diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EcrTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EcrTest.java index 622b660d01..0edce34caf 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EcrTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EcrTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.Isolated; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.services.ecr.EcrClient; import software.amazon.awssdk.services.ecr.model.*; @@ -23,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; @DisplayName("ECR Container Registry") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@Isolated class EcrTest { private static EcrClient ecr; @@ -33,6 +35,12 @@ class EcrTest { @BeforeAll static void setup() { ecr = TestFixtures.ecrClient(); + // Floci removes the backing registry when the last repository goes and starts a new one + // on the next create, which can stall for as long as Floci caches the old container's + // address. These tests are not about that, so one repository stays for the whole class. + String keepRegistry = "floci-it/keep-registry-" + System.nanoTime(); + ecr.createRepository(b -> b.repositoryName(keepRegistry)); + reposToCleanup.add(keepRegistry); } @AfterAll diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EcsTests.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EcsTests.java index c0cbe481af..bffb7f113a 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EcsTests.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EcsTests.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.Isolated; import software.amazon.awssdk.core.waiters.WaiterResponse; import software.amazon.awssdk.services.ecs.EcsClient; import software.amazon.awssdk.services.ecs.model.*; @@ -14,6 +15,7 @@ import static org.assertj.core.api.Assertions.*; @DisplayName("ECS Elastic Container Service") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@Isolated class EcsTests { private static EcsClient ecs; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/FirehoseDataFormatConversionTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/FirehoseDataFormatConversionTest.java index 0a18feef35..5509adda01 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/FirehoseDataFormatConversionTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/FirehoseDataFormatConversionTest.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.firehose.FirehoseClient; import software.amazon.awssdk.services.firehose.model.*; @@ -17,6 +18,7 @@ import static org.assertj.core.api.Assertions.*; */ @DisplayName("Firehose data format conversion configuration") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("floci-duck") class FirehoseDataFormatConversionTest { private static FirehoseClient firehose; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/FirehoseParquetDeliveryTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/FirehoseParquetDeliveryTest.java index 04ec41ea31..5293308b0d 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/FirehoseParquetDeliveryTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/FirehoseParquetDeliveryTest.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.services.athena.AthenaClient; import software.amazon.awssdk.services.athena.model.Datum; @@ -77,6 +78,7 @@ import static org.assertj.core.api.Assertions.assertThat; */ @DisplayName("Firehose data format conversion delivery (JSON to Parquet)") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("floci-duck") class FirehoseParquetDeliveryTest { private static final int BUFFERING_INTERVAL_SECONDS = 5; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GuardDutyTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GuardDutyTest.java index 0b632e9e76..6fbd897bc8 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GuardDutyTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GuardDutyTest.java @@ -2,6 +2,7 @@ package com.floci.test; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.guardduty.GuardDutyClient; import software.amazon.awssdk.services.guardduty.model.AccountDetail; import software.amazon.awssdk.services.guardduty.model.AdminStatus; @@ -35,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @DisplayName("GuardDuty") +@ResourceLock("organizations") class GuardDutyTest { @Test diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/IamTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/IamTest.java index c4204f30fe..3f7ca0a88c 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/IamTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/IamTest.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.iam.IamClient; import software.amazon.awssdk.services.iam.model.AccessDetail; import software.amazon.awssdk.services.iam.model.AddRoleToInstanceProfileRequest; @@ -125,6 +126,7 @@ import static org.assertj.core.api.Assertions.*; @DisplayName("IAM Identity and Access Management") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("organizations") class IamTest { private static IamClient iam; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/Inspector2OrganizationConfigurationTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/Inspector2OrganizationConfigurationTest.java index 723edcde40..08f0db341e 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/Inspector2OrganizationConfigurationTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/Inspector2OrganizationConfigurationTest.java @@ -3,6 +3,7 @@ package com.floci.test; import org.jboss.logging.Logger; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.inspector2.Inspector2Client; import software.amazon.awssdk.services.inspector2.model.AutoEnable; import software.amazon.awssdk.services.inspector2.model.BatchGetAccountStatusResponse; @@ -20,6 +21,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; @DisplayName("Amazon Inspector organization configuration") +@ResourceLock("organizations") class Inspector2OrganizationConfigurationTest { private static final Logger LOG = Logger.getLogger(Inspector2OrganizationConfigurationTest.class); private static final String MANAGEMENT_ACCOUNT = "test"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/MacieOrganizationAdministrationTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/MacieOrganizationAdministrationTest.java index 5d5523f3f4..6c67a9ec27 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/MacieOrganizationAdministrationTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/MacieOrganizationAdministrationTest.java @@ -2,6 +2,7 @@ package com.floci.test; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.macie2.Macie2Client; import software.amazon.awssdk.services.macie2.model.CreateMemberResponse; @@ -11,6 +12,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; @DisplayName("Macie organization administration") +@ResourceLock("organizations") class MacieOrganizationAdministrationTest { private static final String MANAGEMENT_ACCOUNT = "222222222222"; private static final String ADMIN_ACCOUNT = "111111111111"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/OrganizationsTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/OrganizationsTest.java index d215355071..0f7392a1b5 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/OrganizationsTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/OrganizationsTest.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.organizations.OrganizationsClient; import software.amazon.awssdk.services.organizations.model.AccessDeniedException; import software.amazon.awssdk.services.organizations.model.Account; @@ -36,6 +37,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; *

The test tears the organization down at the end so it can be re-run against the same * Floci instance. */ +@ResourceLock("organizations") public class OrganizationsTest { private static final String SCP_CONTENT = diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RamOrganizationSharingTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RamOrganizationSharingTest.java index 9d3c50b505..9e2784554a 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RamOrganizationSharingTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RamOrganizationSharingTest.java @@ -2,6 +2,7 @@ package com.floci.test; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.iam.IamClient; import software.amazon.awssdk.services.organizations.OrganizationsClient; import software.amazon.awssdk.services.organizations.model.AwsOrganizationsNotInUseException; @@ -11,6 +12,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; @DisplayName("RAM organization sharing") +@ResourceLock("organizations") class RamOrganizationSharingTest { private static final String MANAGEMENT_ACCOUNT = "222222222222"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RdsControlPlaneTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RdsControlPlaneTest.java index f16bf6b897..5ada064991 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RdsControlPlaneTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RdsControlPlaneTest.java @@ -4,6 +4,7 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -88,6 +89,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.tuple; @DisplayName("RDS Control Plane") +@ResourceLock("port-5432") class RdsControlPlaneTest { private static final Logger LOG = Logger.getLogger(RdsControlPlaneTest.class.getName()); diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3ControlTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3ControlTest.java index a77d823cfa..3f3d3e7c75 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3ControlTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3ControlTest.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.Isolated; import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.model.BucketAlreadyOwnedByYouException; import software.amazon.awssdk.services.s3.model.CreateBucketRequest; @@ -40,6 +41,7 @@ import static org.assertj.core.api.Assertions.*; */ @DisplayName("S3 Control API — ListTagsForResource / TagResource / UntagResource (#341)") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@Isolated class S3ControlTest { private static S3Client s3; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3SelectTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3SelectTest.java index 5318e6d44f..9da5f22e82 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3SelectTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/S3SelectTest.java @@ -1,6 +1,7 @@ package com.floci.test; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.async.SdkPublisher; @@ -20,6 +21,7 @@ import static org.assertj.core.api.Assertions.*; @DisplayName("S3 SelectObjectContent") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("floci-duck") class S3SelectTest { private static S3Client s3; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SecurityHubOrganizationConfigurationTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SecurityHubOrganizationConfigurationTest.java index 4b10cb9778..49cb51153b 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SecurityHubOrganizationConfigurationTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SecurityHubOrganizationConfigurationTest.java @@ -3,6 +3,7 @@ package com.floci.test; import org.jboss.logging.Logger; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.organizations.OrganizationsClient; import software.amazon.awssdk.services.organizations.model.AlreadyInOrganizationException; import software.amazon.awssdk.services.organizations.model.CreateAccountResponse; @@ -23,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; @DisplayName("Security Hub organization configuration") +@ResourceLock("organizations") class SecurityHubOrganizationConfigurationTest { private static final Logger LOG = Logger.getLogger(SecurityHubOrganizationConfigurationTest.class); private static final String MANAGEMENT_ACCOUNT = "test"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesAccountAttributesTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesAccountAttributesTest.java index 1fd7754922..0488ff6f2c 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesAccountAttributesTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesAccountAttributesTest.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.ses.SesClient; import software.amazon.awssdk.services.ses.model.GetAccountSendingEnabledResponse; import software.amazon.awssdk.services.ses.model.UpdateAccountSendingEnabledRequest; @@ -37,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; @DisplayName("SES account attributes: sending, suppression, VDM (v1 + v2)") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("ses-account") class SesAccountAttributesTest { private static SesClient sesV1; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesBatchGetMetricDataTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesBatchGetMetricDataTest.java index d99bed5f9f..b7c3043e1b 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesBatchGetMetricDataTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesBatchGetMetricDataTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.sesv2.SesV2Client; import software.amazon.awssdk.services.sesv2.model.BatchGetMetricDataQuery; import software.amazon.awssdk.services.sesv2.model.BatchGetMetricDataRequest; @@ -48,6 +49,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; */ @DisplayName("SES v2 BatchGetMetricData") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("ses-account") class SesBatchGetMetricDataTest { private static final String SENDER = "compat-metrics@example.com"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesDedicatedIpPoolTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesDedicatedIpPoolTest.java index d17f242f7e..841ff5f373 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesDedicatedIpPoolTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesDedicatedIpPoolTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.sesv2.SesV2Client; import software.amazon.awssdk.services.sesv2.model.AlreadyExistsException; import software.amazon.awssdk.services.sesv2.model.BadRequestException; @@ -36,6 +37,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; */ @DisplayName("SES v2 Dedicated IP Pools") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("ses-account") class SesDedicatedIpPoolTest { private static final String POOL = "compat-pool-alpha"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesExportJobTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesExportJobTest.java index 0be09c6a6c..8df22f20de 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesExportJobTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesExportJobTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.sesv2.SesV2Client; import software.amazon.awssdk.services.sesv2.model.BadRequestException; import software.amazon.awssdk.services.sesv2.model.Body; @@ -48,6 +49,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; */ @DisplayName("SES v2 Export Jobs") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("ses-account") class SesExportJobTest { private static final String SENDER = "compat-export@example.com"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesMessageInsightsTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesMessageInsightsTest.java index ecd09dd2ca..77cbe17c8e 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesMessageInsightsTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesMessageInsightsTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.sesv2.SesV2Client; import software.amazon.awssdk.services.sesv2.model.Body; import software.amazon.awssdk.services.sesv2.model.Content; @@ -39,6 +40,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; */ @DisplayName("SES v2 Message Insights") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("ses-account") class SesMessageInsightsTest { private static final String SENDER = "compat-insights@example.com"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesReceiptRuleSetTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesReceiptRuleSetTest.java index 776ec65dc4..7f04c2332b 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesReceiptRuleSetTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesReceiptRuleSetTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.ses.SesClient; import software.amazon.awssdk.services.ses.model.AlreadyExistsException; import software.amazon.awssdk.services.ses.model.CannotDeleteException; @@ -39,6 +40,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; */ @DisplayName("SES V1 ReceiptRuleSet, ReceiptRule, and ReceiptFilter") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@ResourceLock("ses-account") class SesReceiptRuleSetTest { private static SesClient ses; diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesRecommendationTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesRecommendationTest.java index f5b1636195..b201c31e9e 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesRecommendationTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/SesRecommendationTest.java @@ -4,6 +4,7 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.services.sesv2.SesV2Client; import software.amazon.awssdk.services.sesv2.model.BadRequestException; import software.amazon.awssdk.services.sesv2.model.ListRecommendationsFilterKey; @@ -28,6 +29,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * rather than a sentence. */ @DisplayName("SES v2 Recommendations") +@ResourceLock("ses-account") class SesRecommendationTest { private static final String DOMAIN = TestFixtures.uniqueName("compat-advisor") + ".example.com"; diff --git a/compatibility-tests/sdk-test-java/src/test/java/io/github/hectorvent/floci/compat/RedshiftRelationalSpectrumTest.java b/compatibility-tests/sdk-test-java/src/test/java/io/github/hectorvent/floci/compat/RedshiftRelationalSpectrumTest.java index 890a24198d..e47658e153 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/io/github/hectorvent/floci/compat/RedshiftRelationalSpectrumTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/io/github/hectorvent/floci/compat/RedshiftRelationalSpectrumTest.java @@ -3,6 +3,7 @@ package io.github.hectorvent.floci.compat; import com.floci.test.TestFixtures; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.services.glue.GlueClient; import software.amazon.awssdk.services.glue.model.DatabaseInput; @@ -24,6 +25,7 @@ import java.util.UUID; import static org.junit.jupiter.api.Assertions.*; +@ResourceLock("floci-duck") class RedshiftRelationalSpectrumTest { @Test @DisplayName("Glue external tables join internal tables through JDBC and the SDK Data API") diff --git a/compatibility-tests/sdk-test-java/src/test/java/io/github/hectorvent/floci/compat/RedshiftSpectrumTest.java b/compatibility-tests/sdk-test-java/src/test/java/io/github/hectorvent/floci/compat/RedshiftSpectrumTest.java index 146713b300..8690b8c83f 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/io/github/hectorvent/floci/compat/RedshiftSpectrumTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/io/github/hectorvent/floci/compat/RedshiftSpectrumTest.java @@ -3,6 +3,7 @@ package io.github.hectorvent.floci.compat; import com.floci.test.TestFixtures; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.services.iam.IamClient; import software.amazon.awssdk.services.iam.model.CreateRoleRequest; @@ -32,6 +33,7 @@ import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +@ResourceLock("floci-duck") class RedshiftSpectrumTest { private static final String ROLE_PREFIX = "SpectrumCompatRole"; diff --git a/compatibility-tests/sdk-test-java/src/test/resources/junit-platform.properties b/compatibility-tests/sdk-test-java/src/test/resources/junit-platform.properties new file mode 100644 index 0000000000..f44d94746c --- /dev/null +++ b/compatibility-tests/sdk-test-java/src/test/resources/junit-platform.properties @@ -0,0 +1,10 @@ +# Test classes run concurrently against the one Floci; the methods of a class stay on one thread, in order. +# Most of the suite's time is spent waiting on containers Floci starts and on minute-aligned metric ticks, +# so a few classes at once overlap those waits. A class that changes account- or region-wide state carries +# @ResourceLock (shared with the classes that read that state) or @Isolated. +junit.jupiter.execution.parallel.enabled=true +junit.jupiter.execution.parallel.mode.default=same_thread +junit.jupiter.execution.parallel.mode.classes.default=concurrent +junit.jupiter.execution.parallel.config.strategy=fixed +junit.jupiter.execution.parallel.config.fixed.parallelism=3 +junit.jupiter.execution.parallel.config.fixed.max-pool-size=3