Skip to content

Commit

Permalink
fix sporadic test with state_machine_spec
Browse files Browse the repository at this point in the history
it sometimes takes more than 1 second to run

task#post_create_destination
  • Loading branch information
kbrock committed Nov 18, 2019
1 parent cc44b50 commit 68e2748
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/models/miq_provision/state_machine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@

task.signal(:post_create_destination)

expect(task.destination.retires_on).to be_between(retires_on - 1.second, retires_on + 1.second)
expect(vm.reload.retires_on).to be_between(retires_on - 1.second, retires_on + 1.second)
expect(task.destination.retires_on).to be_between(retires_on - 2.seconds, retires_on + 2.seconds)
expect(vm.reload.retires_on).to be_between(retires_on - 2.seconds, retires_on + 2.seconds)
expect(vm.retirement_warn).to eq(0)
expect(vm.retired).to be_falsey
end
Expand All @@ -135,7 +135,7 @@
task.signal(:post_create_destination)

expect(task.destination.retires_on).to eq(retires_on)
expect(vm.reload.retires_on).to be_between(retires_on - 1.second, retires_on + 1.second)
expect(vm.reload.retires_on).to be_between(retires_on - 2.seconds, retires_on + 2.seconds)
expect(vm.retirement_warn).to eq(retirement_warn_days)
expect(vm.retired).to be_falsey
end
Expand Down

0 comments on commit 68e2748

Please sign in to comment.