diff --git a/gems/aws-sdk-core/spec/aws/plugins/endpoint_discovery_spec.rb b/gems/aws-sdk-core/spec/aws/plugins/endpoint_discovery_spec.rb index b4480ebb7e8..a6c3277c3fd 100644 --- a/gems/aws-sdk-core/spec/aws/plugins/endpoint_discovery_spec.rb +++ b/gems/aws-sdk-core/spec/aws/plugins/endpoint_discovery_spec.rb @@ -275,8 +275,12 @@ module Plugins ] } ) + cache_thread_block = nil + allow(Thread).to receive(:new) do |&block| + cache_thread_block = block + end c.operation_not_required(foo: 'foo') - sleep(0.1) + cache_thread_block.call expect(c.api_requests.size).to eq(3) c.operation_not_required(foo: 'foo') expect(c.api_requests.size).to eq(4)