diff --git a/.changelog/12590.txt b/.changelog/12590.txt new file mode 100644 index 00000000000..e509980ec4b --- /dev/null +++ b/.changelog/12590.txt @@ -0,0 +1,3 @@ +```release-note:bug +storage: fix a failing testcase, create and update the bucket in same region +``` \ No newline at end of file diff --git a/google/services/storage/resource_storage_bucket_test.go b/google/services/storage/resource_storage_bucket_test.go index 2cc492837e0..d8a079e723a 100644 --- a/google/services/storage/resource_storage_bucket_test.go +++ b/google/services/storage/resource_storage_bucket_test.go @@ -797,7 +797,6 @@ func TestAccStorageBucket_update(t *testing.T) { t.Parallel() var bucket storage.Bucket - var recreated storage.Bucket var updated storage.Bucket bucketName := fmt.Sprintf("tf-test-acl-bucket-%d", acctest.RandInt(t)) @@ -806,27 +805,11 @@ func TestAccStorageBucket_update(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccStorageBucketDestroyProducer(t), Steps: []resource.TestStep{ - { - Config: testAccStorageBucket_basic(bucketName), - Check: resource.ComposeTestCheckFunc( - testAccCheckStorageBucketExists( - t, "google_storage_bucket.bucket", bucketName, &bucket), - resource.TestCheckResourceAttr( - "google_storage_bucket.bucket", "force_destroy", "false"), - ), - }, - { - ResourceName: "google_storage_bucket.bucket", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"force_destroy"}, - }, { Config: testAccStorageBucket_customAttributes(bucketName), Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( - t, "google_storage_bucket.bucket", bucketName, &recreated), - testAccCheckStorageBucketWasRecreated(&recreated, &bucket), + t, "google_storage_bucket.bucket", bucketName, &bucket), resource.TestCheckResourceAttr( "google_storage_bucket.bucket", "force_destroy", "true"), ), @@ -842,7 +825,7 @@ func TestAccStorageBucket_update(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &updated), - testAccCheckStorageBucketWasUpdated(&updated, &recreated), + testAccCheckStorageBucketWasUpdated(&updated, &bucket), resource.TestCheckResourceAttr( "google_storage_bucket.bucket", "force_destroy", "true"), ), @@ -858,7 +841,7 @@ func TestAccStorageBucket_update(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &updated), - testAccCheckStorageBucketWasUpdated(&updated, &recreated), + testAccCheckStorageBucketWasUpdated(&updated, &bucket), resource.TestCheckResourceAttr( "google_storage_bucket.bucket", "force_destroy", "true"), ), @@ -874,7 +857,7 @@ func TestAccStorageBucket_update(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &updated), - testAccCheckStorageBucketWasUpdated(&updated, &recreated), + testAccCheckStorageBucketWasUpdated(&updated, &bucket), resource.TestCheckResourceAttr( "google_storage_bucket.bucket", "force_destroy", "true"), ), @@ -890,7 +873,7 @@ func TestAccStorageBucket_update(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &updated), - testAccCheckStorageBucketWasUpdated(&updated, &recreated), + testAccCheckStorageBucketWasUpdated(&updated, &bucket), resource.TestCheckResourceAttr( "google_storage_bucket.bucket", "force_destroy", "true"), ),