Skip to content

Commit

Permalink
better thread synchronization in Worker spec
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Apr 11, 2024
1 parent 52f982d commit 9fab5aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/datadog/ci/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@

context "when the worker has started" do
context "when the worker is running" do
let(:queue) { Queue.new }
subject(:worker) { described_class.new { queue.pop } }

it do
worker.perform
is_expected.not_to be_done

queue << :done
worker.stop

is_expected.to be_done
end
end

Expand Down

0 comments on commit 9fab5aa

Please sign in to comment.