Skip to content

Commit

Permalink
fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasjpr committed Nov 19, 2024
1 parent b5005e8 commit fa10260
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/worker_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module JoobQ
job = ExampleJob.new(1)
queue = Queue(ExampleJob | FailJob).new("example", 1)
done = Channel(Nil).new
worker = Worker(ExampleJob | FailJob).new(1, done, queue)
worker = Worker(ExampleJob | FailJob).new(1, done, queue, queue.metrics)

before_each do
JoobQ.reset
Expand All @@ -15,19 +15,19 @@ module JoobQ
it "stops worker gracefully" do
worker.run
worker.active?.should be_true
worker.stop!
worker.terminate
worker.active?.should be_false
end

it "stops and syncs multiple workers" do
w1 = Worker(ExampleJob | FailJob).new(1, done, queue)
w2 = Worker(ExampleJob | FailJob).new(2, done, queue)
w1 = Worker(ExampleJob | FailJob).new(1, done, queue, queue.metrics)
w2 = Worker(ExampleJob | FailJob).new(2, done, queue, queue.metrics)

w1.run
w2.run

w1.stop!
w2.stop!
w1.terminate
w2.terminate

w1.active?.should be_false
w2.active?.should be_false
Expand Down

0 comments on commit fa10260

Please sign in to comment.