Skip to content

Commit 3faa913

Browse files
committed
simplify try_wait_until logic
1 parent ff85daf commit 3faa913

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

spec/datadog/opentelemetry/metrics_spec.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,12 @@ def clear_testagent_metrics
5252
def get_testagent_metrics
5353
uri = URI("http://#{agent_host}:#{default_otlp_http_port}/test/session/metrics")
5454

55-
try_wait_until(seconds: 10) do
55+
try_wait_until(seconds: 2) do
5656
response = Net::HTTP.get_response(uri)
5757
next unless response.code == '200'
5858

5959
parsed = JSON.parse(response.body, symbolize_names: false)
6060
next parsed if parsed.is_a?(Array) && !parsed.empty?
61-
62-
if parsed.is_a?(Hash)
63-
metrics_array = parsed['metrics']
64-
next metrics_array if metrics_array.is_a?(Array) && !metrics_array.empty?
65-
next [parsed]
66-
end
6761
end
6862
end
6963

0 commit comments

Comments
 (0)