Skip to content

Commit

Permalink
reintroduce AsyncTransport spec while skipping jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Sep 26, 2023
1 parent ac01050 commit ee4a925
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec/datadog/tracing/workers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,36 @@
expect(worker.start).to be nil
end
end

describe '#stop' do
before { skip if PlatformHelpers.jruby? } # DEV: this test causes jruby-9.2 to fail

it 'stops underlying thread with default timeout' do
expect_any_instance_of(Thread).to receive(:join).with(
Datadog::Tracing::Workers::AsyncTransport::DEFAULT_SHUTDOWN_TIMEOUT
).and_call_original

worker.start
worker.stop
end

context 'with shutdown timeout configured' do
let(:worker) do
described_class.new(
transport: nil,
buffer_size: 100,
on_trace: task,
interval: 0.5,
shutdown_timeout: 1000
)
end

it 'stops underlying thread with configured timeout' do
expect_any_instance_of(Thread).to receive(:join).with(1000).and_call_original

worker.start
worker.stop
end
end
end
end

0 comments on commit ee4a925

Please sign in to comment.