k1LoW / awspec

RSpec tests for your AWS resources.
MIT License
1.17k stars 193 forks source link

Error executing request, Exception : ComputeEnvironments and MaxResults cannot both be set #563

Open gorogoroyasu opened 2 years ago

gorogoroyasu commented 2 years ago

An error occurred when I executed batch related specs. Details and how I fixed are shown below.

Environment

ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
awspec (1.26.0)
aws-sdk-batch (1.62.0) # latest maybe: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Batch.html

Code

require "awspec"

describe batch_compute_environment('MY-BATCH-NAME') do
  it { should exist }
end

Error

batch_compute_environment 'MY-BATCH-NAME' is expected to exist
Failure/Error: it { should exist }

Aws::Batch::Errors::ClientException:
Error executing request, Exception : ComputeEnvironments and MaxResults cannot both be set

Same error occurred when I execute batch_job_queue and batch_job_definition.

How I Fixed

Remove , max_results: 1 from this line. After fixing this line, I succeeded in testing batch_compute_environment.

Caution

I have no idea about the side effect of this change.