diff --git a/test/plugin/test_in_tail.rb b/test/plugin/test_in_tail.rb index 14961d0c45..c4830a4e82 100644 --- a/test/plugin/test_in_tail.rb +++ b/test/plugin/test_in_tail.rb @@ -34,8 +34,9 @@ def cleanup_directory(path) Dir.glob("*", base: path).each do |name| begin cleanup_file(File.join(path, name)) - rescue + rescue => e # expect test driver block release already owned file handle. + puts "Failed to clean up #{File.join(path, name)}: #{e}" end end else @@ -978,6 +979,7 @@ def test_rotate_file_with_write_old_and_no_new_file(data) end def sub_test_rotate_file(config = nil, expect_emits: nil, expect_records: nil, timeout: 5) + File.open("#{TMP_DIR}/tail.pos", "wb") { |f| } file = Fluent::FileWrapper.open("#{TMP_DIR}/tail.txt", "wb") file.puts "test1" file.puts "test2"