From d2373e2d2e9c542eaf4c099c01453689f44d6a31 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Thu, 26 Aug 2021 11:03:55 +0900 Subject: [PATCH] in_tail: Fix a broken test on Windows Signed-off-by: Takuro Ashie --- test/plugin/test_in_tail.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/plugin/test_in_tail.rb b/test/plugin/test_in_tail.rb index 6cdb16c113..5c72fd2920 100644 --- a/test/plugin/test_in_tail.rb +++ b/test/plugin/test_in_tail.rb @@ -2171,10 +2171,14 @@ def test_ENOENT_error_after_setup_watcher 'format' => 'none', }) d = create_driver(config) + file_deleted = false mock.proxy(d.instance).existence_path do |hash| - cleanup_file(path) + unless file_deleted + cleanup_file(path) + file_deleted = true + end hash - end.at_least(1) + end.twice assert_nothing_raised do d.run(shutdown: false) {} end @@ -2200,7 +2204,7 @@ def test_EACCES_error_after_setup_watcher mock.proxy(d.instance).existence_path do |hash| FileUtils.chmod(0000, "#{TMP_DIR}/noaccess") hash - end.at_least(1) + end.twice assert_nothing_raised do d.run(shutdown: false) {} end