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

tests/s3_bucket_object: ignoreTags acceptance test fails locally in parallel #17599

Closed
YakDriver opened this issue Feb 12, 2021 · 2 comments · Fixed by #17716
Closed

tests/s3_bucket_object: ignoreTags acceptance test fails locally in parallel #17599

YakDriver opened this issue Feb 12, 2021 · 2 comments · Fixed by #17716
Labels
service/s3 Issues and PRs that pertain to the s3 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@YakDriver
Copy link
Member

YakDriver commented Feb 12, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.14.6
AWS Provider v3.28.0

Affected Resource(s)

  • aws_bucket_object

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider "aws" {
  ignore_tags {
    key_prefixes = ["ignorekey"]
  }
}

resource "aws_s3_bucket" "object_bucket" {
  bucket = "tf-acc-test-1234"

  versioning {
    enabled = true
  }
}

resource "aws_s3_bucket_object" "object" {
  bucket  = aws_s3_bucket.object_bucket.bucket
  key     = "test-key"
  content = "stuff"
}

Strange Behavior

This seems to happen nearly 100% of the time:

  1. Run ignoreTags test locally by itself ==> PASS
  2. Run ignoreTags test locally as part of aws_s3_bucket_object suite ==> FAIL

By itself: PASS

% TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run='TestAccAWSS3BucketObject_ignoreTags' -timeout 120m
--- PASS: TestAccAWSS3BucketObject_ignoreTags (43.75s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	44.818s

With the suite, parallel: FAIL

% TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run='TestAccAWSS3BucketObject_' -timeout 120m
...
    resource_aws_s3_bucket_object_test.go:1115: Step 1/2 error: After applying this test step and performing a `terraform refresh`, the plan was not empty.

        An execution plan has been generated and is shown below.
        Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_s3_bucket_object.object will be updated in-place
          ~ resource "aws_s3_bucket_object" "object" {
                id            = "test-key"
              ~ tags          = {
                  - "ignorekey1" = "ignorevalue1" -> null
                }
                # (10 unchanged attributes hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAWSS3BucketObject_ignoreTags (35.21s) <=========================================
--- PASS: TestAccAWSS3BucketObject_acl (81.63s)
--- PASS: TestAccAWSS3BucketObject_content (27.15s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (25.32s)
--- PASS: TestAccAWSS3BucketObject_defaultBucketSSE (35.58s)
--- PASS: TestAccAWSS3BucketObject_empty (25.60s)
--- PASS: TestAccAWSS3BucketObject_etagEncryption (29.98s)
--- PASS: TestAccAWSS3BucketObject_kms (26.89s)
--- PASS: TestAccAWSS3BucketObject_metadata (75.75s)
--- PASS: TestAccAWSS3BucketObject_noNameNoKey (5.06s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithNone (82.51s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithOn (59.44s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithNone (74.88s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithSet (102.33s)
--- PASS: TestAccAWSS3BucketObject_source (25.33s)
--- PASS: TestAccAWSS3BucketObject_sse (31.70s)
--- PASS: TestAccAWSS3BucketObject_storageClass (117.84s)
--- PASS: TestAccAWSS3BucketObject_tags (102.65s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes (97.78s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSingleSlash (99.32s)
--- PASS: TestAccAWSS3BucketObject_tagsMultipleSlashes (102.62s)
--- PASS: TestAccAWSS3BucketObject_updates (57.18s)
--- PASS: TestAccAWSS3BucketObject_updateSameFile (59.67s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (59.69s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint (61.95s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (29.26s)
--- SKIP: TestAccAWSS3BucketObject_NonVersioned (1.26s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	119.241s

With the suite, non-parallel: PASS

% TF_ACC=1 go test ./aws -v -count 1 -parallel 1 -run='TestAccAWSS3BucketObject_' -timeout 120m
--- PASS: TestAccAWSS3BucketObject_noNameNoKey (2.40s)
--- PASS: TestAccAWSS3BucketObject_acl (67.26s)
--- PASS: TestAccAWSS3BucketObject_sse (23.76s)
--- PASS: TestAccAWSS3BucketObject_kms (24.87s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint (51.18s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (45.51s)
--- PASS: TestAccAWSS3BucketObject_updateSameFile (45.38s)
--- PASS: TestAccAWSS3BucketObject_updates (44.97s)
--- SKIP: TestAccAWSS3BucketObject_NonVersioned (0.00s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (23.71s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (23.36s)
--- PASS: TestAccAWSS3BucketObject_etagEncryption (23.41s)
--- PASS: TestAccAWSS3BucketObject_content (23.41s)
--- PASS: TestAccAWSS3BucketObject_source (23.52s)
--- PASS: TestAccAWSS3BucketObject_empty (24.25s)
--- PASS: TestAccAWSS3BucketObject_ignoreTags (46.77s) <=========================================
--- PASS: TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes (88.57s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSingleSlash (89.12s)
--- PASS: TestAccAWSS3BucketObject_tags (87.43s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithNone (66.85s)
--- PASS: TestAccAWSS3BucketObject_defaultBucketSSE (28.37s)
--- PASS: TestAccAWSS3BucketObject_tagsMultipleSlashes (87.79s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithOn (45.51s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithNone (67.53s)
--- PASS: TestAccAWSS3BucketObject_metadata (65.30s)
--- PASS: TestAccAWSS3BucketObject_storageClass (108.05s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithSet (86.89s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1316.244s

References

@ghost ghost added the service/s3 Issues and PRs that pertain to the s3 service. label Feb 12, 2021
@bflad
Copy link
Contributor

bflad commented Feb 12, 2021

Updating the acceptance test to instantiate a var providers []*schema.Provider and replacing Providers: testAccProviders, with ProviderFactories: testAccProviderFactoriesInternal(&providers), should resolve this issue. 👍

@bflad bflad added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Feb 12, 2021
@ghost
Copy link

ghost commented Mar 22, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/s3 Issues and PRs that pertain to the s3 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
2 participants