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