Skip to content

Commit

Permalink
Merge pull request #2939 from ganmacs/fix-unstable-test
Browse files Browse the repository at this point in the history
Fix unstable test
  • Loading branch information
ganmacs authored Apr 9, 2020
2 parents 07b2e24 + c7c65a8 commit 2d50f34
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/plugin/test_output_as_buffered_retries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -895,17 +895,25 @@ def get_log_time(msg, logs)

@i.flush_thread_wakeup
waiting(4){ Thread.pass until @i.write_count > 0 }
waiting(4) do
state = @i.instance_variable_get(:@output_flush_threads).first
state.thread.status == 'sleep'
end

assert{ @i.write_count > 0 }
assert{ @i.num_errors > 0 }
assert(@i.write_count > 0)
assert(@i.num_errors > 0)

now = @i.next_flush_time
Timecop.freeze( now )
@i.flush_thread_wakeup
waiting(4){ Thread.pass until @i.write_count > 1 }
waiting(4) do
state = @i.instance_variable_get(:@output_flush_threads).first
state.thread.status == 'sleep'
end

assert{ @i.write_count > 1 }
assert{ @i.num_errors > 1 }
assert(@i.write_count > 1)
assert(@i.num_errors > 1)
end
end
end

0 comments on commit 2d50f34

Please sign in to comment.