test/instrumentation/grpc_test.rb in instana-1.5.1 vs test/instrumentation/grpc_test.rb in instana-1.5.2

- old
+ new

@@ -77,10 +77,13 @@ ) end assert 'Hello World', response.message + # Pause for a split second to allow traces to be queued + sleep 0.2 + assert_equal 2, ::Instana.processor.queue_count client_trace, server_trace = differentiate_trace( Instana.processor.queued_traces ) @@ -109,10 +112,13 @@ ) end assert '01234', response.message + # Pause for a split second to allow traces to be queued + sleep 0.2 + assert_equal 2, ::Instana.processor.queue_count client_trace, server_trace = differentiate_trace( Instana.processor.queued_traces ) @@ -136,14 +142,15 @@ Instana.tracer.start_or_continue_trace(:rpctests) do responses = client_stub.ping_with_server_stream( PingPongService::PingRequest.new(message: 'Hello World') ) end - sleep 1 - assert %w(0 1 2 3 4), responses.map(&:message) + # Pause for a split second to allow traces to be queued + sleep 0.2 + assert_equal 2, ::Instana.processor.queue_count client_trace, server_trace = differentiate_trace( Instana.processor.queued_traces ) @@ -173,10 +180,13 @@ end sleep 1 assert %w(0 2 4 6 8), responses.to_a.map(&:message) + # Pause for a split second to allow traces to be queued + sleep 0.2 + assert_equal 2, ::Instana.processor.queue_count client_trace, server_trace = differentiate_trace( Instana.processor.queued_traces ) @@ -200,10 +210,13 @@ client_stub.fail_to_ping( PingPongService::PingRequest.new(message: 'Hello World')) rescue end end + # Pause for a split second to allow traces to be queued + sleep 0.2 + assert_equal 2, ::Instana.processor.queue_count client_trace, server_trace = differentiate_trace( Instana.processor.queued_traces ) @@ -232,10 +245,13 @@ ) rescue end end + # Pause for a split second to allow traces to be queued + sleep 0.2 + assert_equal 2, ::Instana.processor.queue_count client_trace, server_trace = differentiate_trace( Instana.processor.queued_traces ) @@ -262,12 +278,14 @@ PingPongService::PingRequest.new(message: 'Hello World') ) rescue end end - sleep 1 + # Pause for a split second to allow traces to be queued + sleep 0.2 + assert_equal 2, ::Instana.processor.queue_count client_trace, server_trace = differentiate_trace( Instana.processor.queued_traces ) @@ -292,10 +310,12 @@ (0..5).map do |index| PingPongService::PingRequest.new(message: (index * 2).to_s) end ) end - sleep 1 + + # Pause for a split second to allow traces to be queued + sleep 0.2 assert_equal 2, ::Instana.processor.queue_count client_trace, server_trace = differentiate_trace( Instana.processor.queued_traces )