Skip to content

Commit cfcb81a

Browse files
committed
simplify try_wait_until logic
1 parent ff85daf commit cfcb81a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

spec/datadog/opentelemetry/metrics_spec.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ def get_testagent_metrics
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
61+
next parsed['metrics'] if parsed.is_a?(Hash) && parsed['metrics'].is_a?(Array) && !parsed['metrics'].empty?
6762
end
6863
end
6964

0 commit comments

Comments
 (0)