Skip to content

Commit

Permalink
Test Runner: Catch Net::ReadTimeout when retrying actions
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Jul 23, 2024
1 parent dddf9b6 commit 95dd5b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions elasticsearch-api/api-spec-testing/test_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def run_actions_and_retry(actions)
action.execute(client)
true
rescue Elastic::Transport::Transport::Errors::RequestTimeout,
Net::ReadTimeout, # TODO: Replace this if we change adapters
Elastic::Transport::Transport::Errors::ServiceUnavailable => e
# The action sometimes gets the cluster in a recovering state, so we
# retry a few times and then raise an exception if it's still
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
if defined_path_parts.empty?
{ endpoint: spec.endpoint_name }
else
{ endpoint: spec.endpoint_name, defined_params: defined_path_parts}
{ endpoint: spec.endpoint_name, defined_params: defined_path_parts }
end
end

Expand Down
4 changes: 2 additions & 2 deletions elasticsearch/spec/integration/opentelemetry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
end

after do
client.delete(index: 'myindex', id: 1); rescue
client.delete(index: 'myindex', id: 1); rescue
end

context 'when a request is instrumented' do
it 'sets the span name to the endpoint id' do
client.search(body: { query: { match: {a: 1} } })
client.search(body: { query: { match: { a: 1 } } })
expect(span.name).to eq 'search'
end

Expand Down

0 comments on commit 95dd5b7

Please sign in to comment.