From daa0c1bf1e453f1b1c6b1b7f69f85d6117f99fc4 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 b405b48093..d85aabf89b 100644 --- a/test/plugin/test_in_tail.rb +++ b/test/plugin/test_in_tail.rb @@ -2271,10 +2271,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 @@ -2300,7 +2304,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