Skip to content

Commit

Permalink
Merge pull request #2066 from candlepin/awood/intermittent-rspec-fail…
Browse files Browse the repository at this point in the history
…ures

Fix issue with intermittent rspec test failure.
  • Loading branch information
wottop committed Jul 31, 2018
2 parents 3712797 + 00926f2 commit 8d9d0b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server/spec/job_status_spec.rb
Expand Up @@ -140,8 +140,22 @@
end

it 'should allow user to cancel a job it initiated' do
@cp.set_scheduler_status(false)
job = @user.autoheal_org(@owner['key'])
#make sure we see a job waiting to go
joblist = @cp.list_jobs(@owner['key'])
expect(joblist.find { |j| j['id'] == job['id'] }['state']).to eq('CREATED')

@user.cancel_job(job['id'])
#make sure we see a job canceled
joblist = @cp.list_jobs(@owner['key'])
expect(joblist.find { |j| j['id'] == job['id'] }['state']).to eq('CANCELED')

@cp.set_scheduler_status(true)
sleep 1 #let the job queue drain..
#make sure job didn't flip to FINISHED
joblist = @cp.list_jobs(@owner['key'])
expect(joblist.find { |j| j['id'] == job['id'] }['state']).to eq('CANCELED')
end

it 'should not allow user to cancel a job it did not initiate' do
Expand Down

0 comments on commit 8d9d0b5

Please sign in to comment.