Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test(s): TestAccGKEHubFeatureMembership_gkehubFeatureAcm* #14591

Open
megan07 opened this issue May 12, 2023 · 15 comments
Open

Failing test(s): TestAccGKEHubFeatureMembership_gkehubFeatureAcm* #14591

megan07 opened this issue May 12, 2023 · 15 comments

Comments

@megan07
Copy link
Contributor

megan07 commented May 12, 2023

Failure rates

  • 100% since 2023-05-10

Impacted tests

  • TestAccGKEHubFeatureMembership_gkehubFeatureAcmAllFields
  • TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
  • TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci

Affected Resource(s)

  • google_gke_hub_feature_membership

Nightly build test history

  • Link

Message(s)

Step 1/6 error: Error running apply: exit status 1
Error: Error creating FeatureMembership: googleapi: Error 400: InvalidValueError for field version: unsupported ACM version 1.12.0 for Membership projects/*/locations/global/memberships/tf-test14c0y4ft10g, supported versions are 1.13.0, 1.13.1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.15.0
with google_gke_hub_feature_membership.feature_member,
on terraform_plugin_test.tf line 104, in resource "google_gke_hub_feature_membership" "feature_member":
104: resource "google_gke_hub_feature_membership" "feature_member" {

As of July 2023:

------- Stdout: -------
=== RUN   TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
=== PAUSE TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
=== CONT  TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
    vcr_utils.go:152: Step 5/8 error: After applying this test step, the plan was not empty.
        stdout:
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        Terraform will perform the following actions:
          # google_gke_hub_feature_membership.feature_member_2 will be updated in-place
          ~ resource "google_gke_hub_feature_membership" "feature_member_2" {
                id         = "projects/tf-test-gkehubdr4wbtvx6r/locations/global/features/configmanagement/membershipId/tf-test2dr4wbtvx6r"
                # (4 unchanged attributes hidden)
              ~ configmanagement {
                    # (1 unchanged attribute hidden)
                  ~ policy_controller {
                      ~ exemptable_namespaces      = [
                          - "1234",
                            "different",
                          + "1234",
                        ]
                        # (6 unchanged attributes hidden)
                        # (1 unchanged block hidden)
                    }
                    # (2 unchanged blocks hidden)
                }
            }
        Plan: 0 to add, 1 to change, 0 to destroy.
    testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1
        Error: Error deleting FeatureMembership: googleapi: Error 409: unable to queue the operation
        Details:
        [
          {
            "@type": "type.googleapis.com/google.rpc.ResourceInfo",
            "resourceName": "projects/tf-test-gkehubdr4wbtvx6r/locations/global/features/configmanagement"
          }
        ]
--- FAIL: TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate (832.27s)
FAIL
@melinath
Copy link
Collaborator

b/284514917

@SarahFrench
Copy link
Member

Updated the description with a new error that's affecting those tests

@sahsagar-google
Copy link

Is the error only related to the order of the returned fields?

@melinath
Copy link
Collaborator

yes - our preference in cases like this is to use a diff suppress function (diff_suppress_func in MMv1) to ignore diffs related to ordering (by sorting the lists and seeing if they end up the same, for example). The diff suppress will be run against the whole list and also against each element in the list, so you'd need to make sure that it's a no-op if it receives a string rather than a slice.

@melinath
Copy link
Collaborator

Slight correction after further discussion - rather than a diff suppress, it would be great to use a custom flattener that makes the order of values in state match the order in the configuration. That will suppress the diff and also make cleaner diffs if the list is changed in the future.

@SarahFrench
Copy link
Member

New failure here:

    vcr_utils.go:152: Step 5/8 error: After applying this test step, the plan was not empty.
        stdout:
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        Terraform will perform the following actions:
          # google_gke_hub_feature_membership.feature_member will be updated in-place
          ~ resource "google_gke_hub_feature_membership" "feature_member" {
                id         = "projects/tf-test-gkehubvxugwj213m/locations/global/features/configmanagement/membershipId/tf-test1vxugwj213m"
                # (4 unchanged attributes hidden)
              ~ configmanagement {
                    # (1 unchanged attribute hidden)
                  - policy_controller {
                      - audit_interval_seconds     = "100" -> null
                      - enabled                    = true -> null
                      - exemptable_namespaces      = [
                          - "onetwothree",
                          - "fourfive",
                        ] -> null
                      - log_denies_enabled         = true -> null
                      - mutation_enabled           = false -> null
                      - referential_rules_enabled  = true -> null
                      - template_library_installed = true -> null
                      - monitoring {
                          - backends = [
                              - "PROMETHEUS",
                              - "CLOUD_MONITORING",
                            ] -> null
                        }
                    }
                    # (1 unchanged block hidden)
                }
            }
        Plan: 0 to add, 1 to change, 0 to destroy.
    testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1
        Error: Error deleting FeatureMembership: googleapi: Error 409: unable to queue the operation
        Details:
        [
          {
            "@type": "type.googleapis.com/google.rpc.ResourceInfo",
            "resourceName": "projects/tf-test-gkehubvxugwj213m/locations/global/features/configmanagement"
          }
        ]
--- FAIL: TestAccGKEHubFeatureMembership_gkehubFeatureAcmAllFields (575.53s)
FAIL

@melinath
Copy link
Collaborator

@sahsagar-google we've now added reusable functions that handle the main logic of the custom flattener we'd want in this case: https://googlecloudplatform.github.io/magic-modules/develop/permadiff/#list-order

@melinath
Copy link
Collaborator

although the error message has changed significantly 🤔

@melinath
Copy link
Collaborator

melinath commented Sep 3, 2024

  • TestAccGKEHubFeatureMembership_gkehubFeatureAcmAllFields is no longer failing in this way
  • TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci is no longer failing in this way
  • TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate is failing at (almost) 100% with a permadiff and problems cleaning up resources:
resource_gke_hub_feature_membership_test.go:33: Step 5/8 error: After applying this test step, the plan was not empty.
        stdout:
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        Terraform will perform the following actions:
          # google_gke_hub_feature_membership.feature_member_2 will be updated in-place
          ~ resource "google_gke_hub_feature_membership" "feature_member_2" {
                id                  = "projects/tf-test-gkehub1pofiidu84/locations/global/features/configmanagement/membershipId/tf-test21pofiidu84"
                # (5 unchanged attributes hidden)
              ~ configmanagement {
                    # (2 unchanged attributes hidden)
                  ~ policy_controller {
                      ~ audit_interval_seconds     = "10" -> "9"
                      ~ exemptable_namespaces      = [
                          ~ "asdf" -> "different",
                            "1234",
                        ]
                      ~ template_library_installed = true -> false
                        # (4 unchanged attributes hidden)
                        # (1 unchanged block hidden)
                    }
                    # (2 unchanged blocks hidden)
                }
            }
        Plan: 0 to add, 1 to change, 0 to destroy.
    testing_new.go:90: Error running post-test destroy, there may be dangling resources: exit status 1
        Error: Error waiting for Deleting Membership: Error code 13, message: an internal error has occurred
        Error: Error waiting for Deleting Membership: Error code 13, message: an internal error has occurred

The TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate never started passing consistently and the error is very similar so I'd be inclined to say it's not fixed yet.

@roaks3
Copy link
Collaborator

roaks3 commented Sep 30, 2024

TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci and TestAccGKEHubFeatureMembership_gkehubFeatureAcmAllFields now fail 100% with an error that looks like an API change:

=== RUN   TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci
=== PAUSE TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci
=== CONT  TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci
    resource_gke_hub_feature_membership_test.go:582: Step 1/6 error: Error running apply: exit status 1
        Error: Error creating FeatureMembership: googleapi: Error 400: InvalidValueError for field configSync.enabled: to install Config Sync, please set the field `configSync.enabled` to `true` explicitly; to uninstall Config Sync, please remove the Git or OCI configuration from Membership projects/821339993213/locations/global/memberships/tf-test1l3a286421j
          with google_gke_hub_feature_membership.feature_member,
          on terraform_plugin_test.tf line 104, in resource "google_gke_hub_feature_membership" "feature_member":
         104: resource "google_gke_hub_feature_membership" "feature_member" {
--- FAIL: TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci (889.88s)
FAIL

@sahsagar-google
Copy link

Asked Haiyan to take a look at this. Either she or I will provide an update soon. Thank you.

@haiyanmeng
Copy link

GoogleCloudPlatform/magic-modules#11880 should fix this.

@zli82016
Copy link
Collaborator

zli82016 commented Oct 2, 2024

TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci and TestAccGKEHubFeatureMembership_gkehubFeatureAcmAllFields now fail 100% with an error that looks like an API change:

=== RUN   TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci
=== PAUSE TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci
=== CONT  TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci
    resource_gke_hub_feature_membership_test.go:582: Step 1/6 error: Error running apply: exit status 1
        Error: Error creating FeatureMembership: googleapi: Error 400: InvalidValueError for field configSync.enabled: to install Config Sync, please set the field `configSync.enabled` to `true` explicitly; to uninstall Config Sync, please remove the Git or OCI configuration from Membership projects/821339993213/locations/global/memberships/tf-test1l3a286421j
          with google_gke_hub_feature_membership.feature_member,
          on terraform_plugin_test.tf line 104, in resource "google_gke_hub_feature_membership" "feature_member":
         104: resource "google_gke_hub_feature_membership" "feature_member" {
--- FAIL: TestAccGKEHubFeatureMembership_gkehubFeatureAcmOci (889.88s)
FAIL

GoogleCloudPlatform/magic-modules#11880 should fix these two tests.

@zli82016
Copy link
Collaborator

The PR GoogleCloudPlatform/magic-modules#11964 will fix the permadiff in the field template_library_installed

@zli82016
Copy link
Collaborator

zli82016 commented Oct 10, 2024

Sometimes the test TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate fails with an internal error

------- Stdout: -------
=== RUN   TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
=== PAUSE TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
=== CONT  TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate
    resource_gke_hub_feature_membership_test.go:33: Step 1/8 error: Error running apply: exit status 1
        Error: Error creating FeatureMembership: operation received error: error code "13", message: an internal error has occurred, details: []
         details: map[]
          with google_gke_hub_feature_membership.feature_member_2,
          on terraform_plugin_test.tf line 169, in resource "google_gke_hub_feature_membership" "feature_member_2":
         169: resource "google_gke_hub_feature_membership" "feature_member_2" {
--- FAIL: TestAccGKEHubFeatureMembership_gkehubFeatureAcmUpdate (903.85s)
FAIL

I asked the service team for the exact error in b/284514917. Also, I will keep monitoring this test to see if the error happens again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants