Make the periodic test converge a bit more robust

This test has been a bit flaky since it relies on an external thread to
trigger, this commit add a bit more time for the trigger to happen and
also add a retry.

Fixes: #6929

Fixes #6945
This commit is contained in:
Pier-Hugues Pellerin 2017-04-20 16:31:25 -04:00
parent 0b0d37b1d3
commit 251ae7fe0e

View file

@ -142,9 +142,14 @@ describe LogStash::Agent do
it "converges periodically the pipelines from the configs source" do
agent_task = start_agent(subject)
sleep(interval * 10) # let the interval reload a few times
sleep(2) # let the interval reload a few times
expect(subject).to have_running_pipeline?(pipeline_config)
expect(source_loader.fetch_count).to be > 1
# we rely on a periodic thread to call fetch count, we have seen unreliable run on
# travis, so lets add a few retries
try do
expect(source_loader.fetch_count).to be > 1
end
subject.shutdown
agent_task.stop!