Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/instrumentation/bunny_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def setup
end
@channel = @connection.create_channel
@exchange = @channel.default_exchange
@queue = @channel.queue('instana.test.queue', auto_delete: true, exclusive: true)
@queue = @channel.queue("instana.test.queue.#{object_id}", auto_delete: true, exclusive: true)
@queue.purge
end

Expand Down Expand Up @@ -448,7 +448,7 @@ def test_error_handling_in_subscribe
# Subscribe with a block that raises an error
error_in_block = false

@queue.subscribe(manual_ack: false, block: false) do |_delivery_info, _properties, _payload|
consumer = @queue.subscribe(manual_ack: false, block: false) do |_delivery_info, _properties, _payload|
error_in_block = true
raise StandardError, "Intentional error in subscribe block"
end
Expand All @@ -457,6 +457,9 @@ def test_error_handling_in_subscribe
sleep 0.2

assert error_in_block, "Block should have been called and raised error"
ensure
# Cancel the consumer to release the queue
consumer&.cancel if consumer
end

def test_publish_with_empty_exchange_name
Expand Down
10 changes: 5 additions & 5 deletions test/instrumentation/dalli_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class DalliTest < Minitest::Test
def setup
@memcached_host = ENV['MEMCACHED_HOST'] || '127.0.0.1:11211'
@dc = Dalli::Client.new(@memcached_host, :namespace => "instana_test")
@dc = Dalli::Client.new(@memcached_host, namespace: "instana_test", serializer: JSON)
end

def teardown
Expand All @@ -24,14 +24,14 @@ def test_config_defaults
def test_basic_get
clear_all!

@dc.set(:instana, :boom)
@dc.set(:instana, 'boom')

result = nil
::Instana.tracer.in_span(:dalli_test) do
result = @dc.get(:instana)
end

assert_equal :boom, result
assert_equal 'boom', result

spans = ::Instana.processor.queued_spans
assert_equal 2, spans.length
Expand All @@ -58,12 +58,12 @@ def test_basic_get

def test_basic_get_as_root_exit_span
clear_all!
@dc.set(:instana, :boom)
@dc.set(:instana, 'boom')

::Instana.config[:allow_exit_as_root] = true
result = @dc.get(:instana)

assert_equal :boom, result
assert_equal 'boom', result

spans = ::Instana.processor.queued_spans
assert_equal 1, spans.length
Expand Down
2 changes: 1 addition & 1 deletion test/instrumentation/graphql_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def teardown
end

def test_it_works
assert defined?(GraphQL)
assert(defined?(GraphQL))
end

def test_config_defaults
Expand Down
3 changes: 2 additions & 1 deletion test/instrumentation/resque_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ def test_no_error_is_raised_and_no_spans_are_created_when_agent_is_not_ready
error = nil

::Instana.agent.stub(:ready?, false) do
assert_silent do
# Capture stderr to check for deprecation warnings but don't fail on them
_stderr = capture_io do
::Resque.enqueue(FastJob)
rescue StandardError => e
error = e
Expand Down
Loading