From 892de5424bee648d1da2a1f7511de051d692a294 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 14 Jun 2022 18:20:35 +0900 Subject: [PATCH] test_in_tail: Reduce information of test_unwatched_files_should_be_removed Showing whole @tails seems too heavy on CI environment: ``` 2022-06-14T07:17:55.0456030Z Error: test_unwatched_files_should_be_removed(TailInputTest::path): SystemStackError: stack level too deep 2022-06-14T07:17:55.2289960Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/pp.rb:179:in `bind_call' 2022-06-14T07:17:55.2290470Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/pp.rb:179:in `object_address_group' 2022-06-14T07:17:55.2291380Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/pp.rb:241:in `pp_object' ... 2022-06-14T07:17:55.5055170Z /Users/runner/work/fluentd/fluentd/test/plugin/test_in_tail.rb:1615:in `test_unwatched_files_should_be_removed' 2022-06-14T07:17:55.5055350Z 1612: waiting(20) { sleep 0.1 until Dir.glob("#{@tmp_dir}/*.txt").size == 0 } # Ensure file is deleted on Windows 2022-06-14T07:17:55.5055520Z 1613: waiting(5) { sleep 0.1 until d.instance.instance_variable_get(:@tails).keys.size <= 0 } 2022-06-14T07:17:55.5055590Z 1614: 2022-06-14T07:17:55.5055670Z => 1615: assert_equal( 2022-06-14T07:17:55.5055730Z 1616: { 2022-06-14T07:17:55.5055810Z 1617: files: [], 2022-06-14T07:17:55.5055880Z 1618: tails: {} ``` Follow up for #3784 Signed-off-by: Takuro Ashie --- test/plugin/test_in_tail.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/plugin/test_in_tail.rb b/test/plugin/test_in_tail.rb index 8d8fd4eae5..204d45cbff 100644 --- a/test/plugin/test_in_tail.rb +++ b/test/plugin/test_in_tail.rb @@ -1615,11 +1615,11 @@ def test_unwatched_files_should_be_removed assert_equal( { files: [], - tails: {} + tails: [] }, { files: Dir.glob("#{@tmp_dir}/*.txt"), - tails: d.instance.instance_variable_get(:@tails) + tails: d.instance.instance_variable_get(:@tails).keys } ) ensure