test/instrumentation/net-http_test.rb in instana-1.9.6 vs test/instrumentation/net-http_test.rb in instana-1.9.7
- old
+ new
@@ -27,11 +27,11 @@
traces = Instana.processor.queued_traces
rs_trace = traces[0]
http_trace = traces[1]
# Net::HTTP trace validation
- assert_equal 2, http_trace.spans.count
+ assert_equal 2, http_trace.spans.length
spans = http_trace.spans.to_a
first_span = spans[0]
second_span = spans[1]
# Span name validation
@@ -47,11 +47,11 @@
assert_equal "http://127.0.0.1:6511/", second_span[:data][:http][:url]
assert_equal "200", second_span[:data][:http][:status]
assert !second_span.key?(:stack)
# Rack server trace validation
- assert_equal 1, rs_trace.spans.count
+ assert_equal 1, rs_trace.spans.length
rs_span = rs_trace.spans.to_a[0]
# Rack server trace should have the same trace ID
assert_equal http_trace.id, rs_span[:t].to_i
# Rack server trace should have net-http has parent span
@@ -75,11 +75,11 @@
traces = Instana.processor.queued_traces
rs_trace = traces[0]
http_trace = traces[1]
# Net::HTTP trace validation
- assert_equal 2, http_trace.spans.count
+ assert_equal 2, http_trace.spans.length
spans = http_trace.spans.to_a
first_span = spans[0]
second_span = spans[1]
# Span name validation
@@ -95,11 +95,11 @@
assert_equal "http://127.0.0.1:6511/", second_span[:data][:http][:url]
assert_equal "200", second_span[:data][:http][:status]
assert !second_span.key?(:stack)
# Rack server trace validation
- assert_equal 1, rs_trace.spans.count
+ assert_equal 1, rs_trace.spans.length
rs_span = rs_trace.spans.to_a[0]
# Rack server trace should have the same trace ID
assert_equal http_trace.id, rs_span[:t].to_i
# Rack server trace should have net-http has parent span
@@ -120,11 +120,11 @@
rescue Exception
nil
end
traces = Instana.processor.queued_traces
- assert_equal 1, traces.count
+ assert_equal 1, traces.length
t = traces[0]
assert_equal 1, t.spans.count
assert t.has_error?
spans = t.spans.to_a
first_span = spans[0]
@@ -148,13 +148,13 @@
http = Net::HTTP.new("127.0.0.1", 6511)
response = http.request(Net::HTTP::Get.new("/error"))
end
traces = Instana.processor.queued_traces
- assert_equal 2, traces.count
+ assert_equal 2, traces.length
request_trace = traces[1]
- assert_equal 2, request_trace.spans.count
+ assert_equal 2, request_trace.spans.length
assert request_trace.has_error?
http_span = request_trace.spans.to_a[1]
refute_nil http_span.key?(:data)
refute_nil http_span[:data].key?(:http)