From f1f786689a1e873f12f2c9e3c0dc5c642d4142ab Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Thu, 7 Mar 2024 18:42:00 +0900 Subject: [PATCH] in_tail: Make the new tests stable `sleep 1s` is too short for `enable_stat_watcher false`. Signed-off-by: Daijiro Fukuda --- test/plugin/test_in_tail.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/plugin/test_in_tail.rb b/test/plugin/test_in_tail.rb index b57df21e40..58006c0b98 100644 --- a/test/plugin/test_in_tail.rb +++ b/test/plugin/test_in_tail.rb @@ -3049,13 +3049,13 @@ def test_next_rotation_occurs_very_fast_while_old_TW_still_waiting_rotate_wait d.run(expect_records: 6, timeout: 15) do Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt0", "ab") {|f| f.puts "file1 log2"} - sleep 1 + sleep 1.5 # Need to be larger than 1s (the interval of watch_timer) FileUtils.move("#{@tmp_dir}/tail.txt0", "#{@tmp_dir}/tail.txt" + "1") Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt0", "wb") {|f| f.puts "file2 log1"} Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt0", "ab") {|f| f.puts "file2 log2"} - sleep 1 + sleep 1.5 # Need to be larger than 1s (the interval of watch_timer) # Rotate again (Old TailWatcher waiting rotate_wait also calls update_watcher) [1, 0].each do |i| @@ -3233,13 +3233,13 @@ def test_next_rotation_occurs_very_fast_while_old_TW_still_waiting_rotate_wait d.run(expect_records: 6, timeout: 15) do Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt0", "ab") {|f| f.puts "file1 log2"} - sleep 1 + sleep 1.5 # Need to be larger than 1s (the interval of watch_timer) FileUtils.move("#{@tmp_dir}/tail.txt0", "#{@tmp_dir}/tail.txt" + "1") Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt0", "wb") {|f| f.puts "file2 log1"} Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt0", "ab") {|f| f.puts "file2 log2"} - sleep 1 + sleep 1.5 # Need to be larger than 1s (the interval of watch_timer) # Rotate again (Old TailWatcher waiting rotate_wait also calls update_watcher) [1, 0].each do |i|