Skip to content

Commit

Permalink
Wait for #try_flush to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
ganmacs committed Apr 8, 2020
1 parent 7cbd58b commit c7c65a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/plugin/test_output_as_buffered_retries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,10 @@ 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)
Expand All @@ -903,6 +907,10 @@ def get_log_time(msg, logs)
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)
Expand Down

0 comments on commit c7c65a8

Please sign in to comment.