Skip to content

Stub response fails with unexpected parameters #3189

@viraptor

Description

@viraptor

Describe the bug

When trying to test ECS code, the following code fails unexpectedly:

new_task_definition = client.stub_responses(:register_task_definition, task_definition: { task_definition_arn: 'arn:aws:ecs:us-east-1:123456789012:task-definition/23456789012' })
client.stub_responses(:register_task_definition, new_task_definition)

The error is:

     Failure/Error: client.stub_responses(:register_task_definition, new_task_definition)
     
     ArgumentError:
       parameter validator found 2 errors:
         - unexpected value at params[:http]
         - unexpected value at params[:mutex]

Even though http and mutex parameters are not present anywhere in my code.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

No failure

Current Behavior

     Failure/Error: client.stub_responses(:register_task_definition, new_task_definition)
     
     ArgumentError:
       parameter validator found 2 errors:
         - unexpected value at params[:http]
         - unexpected value at params[:mutex]

Reproduction Steps

require 'aws-sdk-ecs'
client = Aws::ECS::Client.new(stub_responses: true)
new_task_definition = client.stub_responses(:register_task_definition, task_definition: { task_definition_arn: 'arn:aws:ecs:us-east-1:123456789012:task-definition/23456789012' })
client.stub_responses(:register_task_definition, new_task_definition)

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-ecs 1.177.0

Environment details (Version of Ruby, OS environment)

ruby 3.4.1, darwin

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions