Skip to content

Commit 6610f5f

Browse files
authored
Fix flaky endpoint discovery cache test (#3093)
1 parent a8c1bbf commit 6610f5f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gems/aws-sdk-core/spec/aws/plugins/endpoint_discovery_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,12 @@ module Plugins
275275
]
276276
}
277277
)
278+
cache_thread_block = nil
279+
allow(Thread).to receive(:new) do |&block|
280+
cache_thread_block = block
281+
end
278282
c.operation_not_required(foo: 'foo')
279-
sleep(0.1)
283+
cache_thread_block.call
280284
expect(c.api_requests.size).to eq(3)
281285
c.operation_not_required(foo: 'foo')
282286
expect(c.api_requests.size).to eq(4)

0 commit comments

Comments
 (0)