test/tracing/custom_test.rb in instana-1.9.7 vs test/tracing/custom_test.rb in instana-1.10.0.slimfast

- old
+ new

@@ -11,17 +11,14 @@ ::Instana.tracer.log_info({:info_logged => 1}) # End tracing ::Instana.tracer.log_end(:custom_trace, {:close_one => 1}) assert_equal false, ::Instana.tracer.tracing? - traces = ::Instana.processor.queued_traces - assert_equal 1, traces.length - t = traces.first - assert_equal 1, t.spans.size - assert t.valid? + spans = ::Instana.processor.queued_spans + assert_equal 1, spans.length - first_span = t.spans.first + first_span = spans.first assert_equal :sdk, first_span[:n] assert first_span[:ts].is_a?(Integer) assert first_span[:ts] > 0 assert first_span[:d].is_a?(Integer) @@ -31,11 +28,10 @@ assert first_span[:data].key?(:sdk) assert first_span[:data][:sdk].key?(:custom) assert first_span[:data][:sdk][:custom].key?(:tags) assert_equal :custom_trace, first_span[:data][:sdk][:name] assert_equal 1, first_span[:data][:sdk][:custom][:tags][:one] - assert_equal :ruby, first_span[:ta] assert first_span.key?(:f) assert first_span[:f].key?(:e) assert first_span[:f].key?(:h) assert_equal ::Instana.agent.agent_uuid, first_span[:f][:h] @@ -60,17 +56,15 @@ # End tracing ::Instana.tracer.log_end(:rack, {:on_trace_end => 1}) assert_equal false, ::Instana.tracer.tracing? - traces = ::Instana.processor.queued_traces - assert_equal 1, traces.length - t = traces.first - assert_equal 2, t.spans.size - assert t.valid? + spans = ::Instana.processor.queued_spans + assert_equal 2, spans.length - first_span, second_span = t.spans.to_a + first_span = find_first_span_by_name(spans, :rack) + second_span = find_first_span_by_name(spans, :custom_span) assert first_span[:ts].is_a?(Integer) assert first_span[:ts] > 0 assert first_span[:d].is_a?(Integer) assert first_span[:d].between?(0, 5) @@ -119,16 +113,14 @@ ::Instana.tracer.log_exit(:custom_span, :on_exit_kv => 1) end ::Instana.tracer.log_end(:rack, {:on_trace_end => 1}) assert_equal false, ::Instana.tracer.tracing? - traces = ::Instana.processor.queued_traces - assert_equal 1, traces.length - t = traces.first - assert_equal 2, t.spans.size - assert t.valid? + spans = ::Instana.processor.queued_spans + assert_equal 2, spans.length - first_span, second_span = t.spans.to_a + first_span = find_first_span_by_name(spans, :rack) + second_span = find_first_span_by_name(spans, :custom_span) assert first_span[:ts].is_a?(Integer) assert first_span[:ts] > 0 assert first_span[:d].is_a?(Integer) assert first_span[:d].between?(0, 5)