Skip to content

Gitlab::SidekiqQueue#drop_jobs! when there are matching jobs: sidekiq_queue_spec.rb failure

Job #1144218792 failed for 37452de8:

rspec './spec/lib/gitlab/sidekiq_queue_spec.rb[1:1:2:1:1]' # Gitlab::SidekiqQueue#drop_jobs! when there are matching jobs when the queue is not processed in time returns a non-completion flag, the number of jobs deleted, and the remaining queue size
rspec './spec/lib/gitlab/sidekiq_queue_spec.rb[1:1:2:2:1]' # Gitlab::SidekiqQueue#drop_jobs! when there are matching jobs when the queue is processed in time returns a completion flag, the number of jobs deleted, and the remaining queue size
1) Gitlab::SidekiqQueue#drop_jobs! when there are matching jobs when the queue is not processed in time returns a non-completion flag, the number of jobs deleted, and the remaining queue size
     Failure/Error:
       expect(sidekiq_queue.drop_jobs!(search_metadata, timeout: 10))
         .to eq(completed: false,
                deleted_jobs: timeout_deleted,
                queue_size: 3 - timeout_deleted)
       expected: {:completed=>false, :deleted_jobs=>1, :queue_size=>2}
            got: {:completed=>false, :deleted_jobs=>0, :queue_size=>3}
       (compared using ==)
       Diff:
       @@ -1,4 +1,4 @@
        :completed => false,
       -:deleted_jobs => 1,
       -:queue_size => 2,
       +:deleted_jobs => 0,
       +:queue_size => 3,
     Shared Example Group: "queue processing" called from ./spec/lib/gitlab/sidekiq_queue_spec.rb:64
     # ./spec/lib/gitlab/sidekiq_queue_spec.rb:38:in `block (5 levels) in <top (required)>'
     # ./spec/lib/gitlab/sidekiq_queue_spec.rb:8:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:365:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:356:in `block (2 levels) in <top (required)>'
     # ./spec/support/redis.rb:29:in `block (2 levels) in <top (required)>'
  2) Gitlab::SidekiqQueue#drop_jobs! when there are matching jobs when the queue is processed in time returns a completion flag, the number of jobs deleted, and the remaining queue size
     Failure/Error:
       expect(sidekiq_queue.drop_jobs!(search_metadata, timeout: 10))
         .to eq(completed: true,
                deleted_jobs: no_timeout_deleted,
                queue_size: 3 - no_timeout_deleted)
       expected: {:completed=>true, :deleted_jobs=>2, :queue_size=>1}
            got: {:completed=>true, :deleted_jobs=>0, :queue_size=>3}
       (compared using ==)
       Diff:
       @@ -1,4 +1,4 @@
        :completed => true,
       -:deleted_jobs => 2,
       -:queue_size => 1,
       +:deleted_jobs => 0,
       +:queue_size => 3,
     Shared Example Group: "queue processing" called from ./spec/lib/gitlab/sidekiq_queue_spec.rb:64
     # ./spec/lib/gitlab/sidekiq_queue_spec.rb:47:in `block (5 levels) in <top (required)>'
     # ./spec/lib/gitlab/sidekiq_queue_spec.rb:8:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:365:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:356:in `block (2 levels) in <top (required)>'
     # ./spec/support/redis.rb:29:in `block (2 levels) in <top (required)>'
Edited by Kyle Wiebers