diff --git a/.github/ci/compat-partition-allowlist-cn-north-1.txt b/.github/ci/compat-partition-allowlist-cn-north-1.txt index 91a1f22e50..3cb7bd075a 100644 --- a/.github/ci/compat-partition-allowlist-cn-north-1.txt +++ b/.github/ci/compat-partition-allowlist-cn-north-1.txt @@ -112,7 +112,3 @@ S3Test#deleteEuBucket S3Test#getBucketLocationEuCentral1 StsTest#assumeRoleWithSaml StsTest#assumeRoleWithSamlAssumedRoleUser - -# Passes alone: in the full run OrganizationsTest#testFullLifecycle fails its arn:aws: assertion -# before cleanup, leaving the caller as the Organizations management account. -SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk 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 5284b4729e..f7006ac749 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 @@ -61,14 +61,16 @@ public class OrganizationsTest { // 1. Create the organization. Organization organization = client.createOrganization(r -> r.featureSet(OrganizationFeatureSet.ALL)) .organization(); - assertThat(organization.id()).matches("o-[a-z0-9]{10}"); - assertThat(organization.featureSet()).isEqualTo(OrganizationFeatureSet.ALL); - assertThat(organization.arn()).startsWith("arn:aws:organizations::"); - assertThat(organization.masterAccountId()).isNotBlank(); - String managementAccountId = organization.masterAccountId(); + // Every assertion runs inside the try, so a failure still deletes the organization: one left + // behind makes the caller its management account for every later test in the run. try { + assertThat(organization.id()).matches("o-[a-z0-9]{10}"); + assertThat(organization.featureSet()).isEqualTo(OrganizationFeatureSet.ALL); + assertThat(organization.arn()).startsWith("arn:aws:organizations::"); + assertThat(managementAccountId).isNotBlank(); + assertThat(client.describeOrganization().organization().id()).isEqualTo(organization.id()); // 2. The root exists with no policy types enabled, and carries the AWS-managed