Skip to content

Go-VCR: Account for clients with extra options containing Retryer overrides #42949

@jar-b

Description

@jar-b

Description

#42801 added a generated functional option for all AWS service clients to handle VCR-specific error codes. However, if a service client has "extra options" implemented which also overrides the default Retryer, the generated option may be overwritten during client initialization. One known example is the S3 client:

func(o *s3.Options) {
o.Retryer = conns.AddIsErrorRetryables(cfg.Retryer().(aws.RetryerV2), retry.IsErrorRetryableFunc(func(err error) aws.Ternary {
if tfawserr.ErrMessageContains(err, errCodeOperationAborted, "A conflicting conditional operation is currently in progress against this resource. Please try again.") {
return aws.TrueTernary
}
return aws.UnknownTernary // Delegate to configured Retryer.
}))
},

When the Retryer is overridden in this way, VCR-specific errors can once again cause replayed acceptance tests to hang while retrying interaction not found errors.

=== NAME  TestAccElastiCacheCluster_Engine_Redis_LogDeliveryConfigurations
    cluster_test.go:1053: Step 1/9 error: Error running apply: exit status 1

        Error: creating S3 Bucket (terraform-20250610133851487100000001): operation error S3: CreateBucket, exceeded maximum number of attempts, 25, https response error StatusCode: 0, RequestID: , HostID: , request send failed, Put "https://terraform-20250610133851487100000001.s3.us-west-2.amazonaws.com/": requested interaction not found

          with aws_s3_bucket.b,
          on terraform_plugin_test.tf line 39, in resource "aws_s3_bucket" "b":
          39: resource "aws_s3_bucket" "b" {

--- FAIL: TestAccElastiCacheCluster_Engine_Redis_LogDeliveryConfigurations (4211.93s)

We should either:

  1. Append to the existing set of retryable functions in the "extra options" (research needed to determine feasability).
  2. Manually include the VCR-specific logic in the "extra options" definition for impacted clients. If this is only a handful of services this may be the pragmatic, if not most elegant, option.

Important Facts and References

Relates #25602
Relates #42801

Would you like to implement a relevant change?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    service/s3Issues and PRs that pertain to the s3 service.technical-debtAddresses areas of the codebase that need refactoring or redesign.testsPRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions