Skip to content

Commit

Permalink
fix to wait force_flush to ensure that expected chunks are written
Browse files Browse the repository at this point in the history
  • Loading branch information
tagomoris committed Oct 5, 2016
1 parent a7813a3 commit b43fa56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/fluent/test/driver/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
require 'fluent/test/driver/event_feeder'

require 'fluent/plugin/output'
require 'timeout'

module Fluent
module Test
Expand All @@ -43,6 +44,7 @@ def run_actual(**kwargs, &block)
super(**kwargs, &block)
if @flush_buffer_at_cleanup
@instance.force_flush
Timeout.timeout(10){ sleep 0.1 until @instance.buffer.queue.size == 0 }
end
end

Expand All @@ -52,6 +54,7 @@ def formatted

def flush
@instance.force_flush
Timeout.timeout(10){ sleep 0.1 until @instance.buffer.queue.size == 0 }
end

def instance_hook_after_started
Expand Down

0 comments on commit b43fa56

Please sign in to comment.