Skip to content

Commit

Permalink
WIP: Check influence of #3542 against unstable rotation tests
Browse files Browse the repository at this point in the history
Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Jun 1, 2022
1 parent d5b74b1 commit b8f0261
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/fluent/plugin/in_tail.rb
Expand Up @@ -392,8 +392,8 @@ def refresh_watchers

def setup_watcher(target_info, pe)
line_buffer_timer_flusher = @multiline_mode ? TailWatcher::LineBufferTimerFlusher.new(log, @multiline_flush_interval, &method(:flush_buffer)) : nil
read_from_head = !@startup || @read_from_head
tw = TailWatcher.new(target_info, pe, log, read_from_head, @follow_inodes, method(:update_watcher), line_buffer_timer_flusher, method(:io_handler), @metrics)
#read_from_head = !@startup || @read_from_head
tw = TailWatcher.new(target_info, pe, log, @read_from_head, @follow_inodes, method(:update_watcher), line_buffer_timer_flusher, method(:io_handler), @metrics)

if @enable_watch_timer
tt = TimerTrigger.new(1, log) { tw.on_notify }
Expand Down
3 changes: 2 additions & 1 deletion test/plugin/test_in_tail.rb
Expand Up @@ -840,6 +840,7 @@ def test_emit_with_disable_stat_watcher(data)
end

def test_always_read_from_head_on_detecting_a_new_file
omit "temporarily disable"
d = create_driver(SINGLE_LINE_CONFIG)

d.run(expect_emits: 1, timeout: 3) do
Expand Down Expand Up @@ -985,7 +986,7 @@ def sub_test_rotate_file(config = nil, expect_emits: nil, expect_records: nil, t

d = create_driver(config)
d.run(expect_emits: expect_emits, expect_records: expect_records, timeout: timeout) do
sleep(0.1) while d.instance.instance_variable_get(:@startup)
# sleep(0.1) while d.instance.instance_variable_get(:@startup)
size = d.emit_count
file.puts "test3"
file.puts "test4"
Expand Down

0 comments on commit b8f0261

Please sign in to comment.