Skip to content

Commit 65ddbce

Browse files
committed
Test Runner: Catch Net::ReadTimeout when retrying actions
1 parent dddf9b6 commit 65ddbce

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

elasticsearch-api/api-spec-testing/test_file.rb

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def run_actions_and_retry(actions)
162162
action.execute(client)
163163
true
164164
rescue Elastic::Transport::Transport::Errors::RequestTimeout,
165+
Net::ReadTimeout, # TODO: Replace this if we change adapters
165166
Elastic::Transport::Transport::Errors::ServiceUnavailable => e
166167
# The action sometimes gets the cluster in a recovering state, so we
167168
# retry a few times and then raise an exception if it's still

elasticsearch-api/spec/elasticsearch/api/perform_request_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
if defined_path_parts.empty?
5959
{ endpoint: spec.endpoint_name }
6060
else
61-
{ endpoint: spec.endpoint_name, defined_params: defined_path_parts}
61+
{ endpoint: spec.endpoint_name, defined_params: defined_path_parts }
6262
end
6363
end
6464

elasticsearch/spec/integration/opentelemetry_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
end
3737

3838
after do
39-
client.delete(index: 'myindex', id: 1); rescue
39+
client.delete(index: 'myindex', id: 1); rescue
4040
end
4141

4242
context 'when a request is instrumented' do
4343
it 'sets the span name to the endpoint id' do
44-
client.search(body: { query: { match: {a: 1} } })
44+
client.search(body: { query: { match: { a: 1 } } })
4545
expect(span.name).to eq 'search'
4646
end
4747

0 commit comments

Comments
 (0)