spec: make timing-sensitive specs a little more flexible

Fixes #10392
This commit is contained in:
Ry Biesemeyer 2019-02-05 22:17:59 +00:00 committed by João Duarte
parent 149684d5b6
commit 328b83815c

View file

@ -113,12 +113,13 @@ describe LogStash::Inputs::Metrics do
end end
it 'should add a stats events to the queue' do it 'should add a stats events to the queue' do
wait(60).for { stats_events.size }.to eq(1) wait(60).for { stats_events.size }.to be >= 1
end end
it 'should add two state events to the queue' do it 'should add two state events to the queue' do
# Triggered event plus the one from `update` # Triggered event plus the one from `update`
wait(60).for { state_events.size }.to eq(2) # and possibly more from our metric_input's timer task
wait(60).for { state_events.size }.to be >= 2
end end
describe "state event" do describe "state event" do