Skip to content

expecting a Worker to have a queue size is broken. #119

@pboling

Description

@pboling

Here is the pry session where I discovered the issue (worker names changed).

    206:             # TODO: I can't understand why there are 2 jobs.
    207:             #       I've done everything I can think of to isolate the test to the single job I expect enqueued.
    208:             expect(OnlyOneLikeThis).to have_queue_size_of(2)
 => 209:             binding.pry
    210:             expect(OnlyOneLikeThis).to have_queued(id: lead.id).in(:slow)

[1] pry(#<RSpec::ExampleGroups::...::OnlyOneLikeThis>)> ResqueSpec.queues
=> {"slow"=>[{:class=>"DoOtherStuff", :args=>[{:id=>1}]}, {:class=>"OnlyOneLikeThis", :args=>[{:id=>1}]}]}

There were 2 jobs total, only one of them was for the worker OnlyOneLikeThis, and my expectation was, I thought, also for that worker: expect(OnlyOneLikeThis).to have_queue_size_of(2), so I would have expected it to fail, since only one job was for that worker.

PR to come shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions