fluentd icon indicating copy to clipboard operation
fluentd copied to clipboard

CI: The `test_unwatched_files_should_be_removed` test fails sometimes

Open daipom opened this issue 2 years ago • 2 comments

Describe the bug

The test_unwatched_files_should_be_removed test fails sometimes.

 Failure: test_unwatched_files_should_be_removed(TailInputTest::path)
/Users/runner/work/fluentd/fluentd/test/plugin/test_in_tail.rb:1616:in `test_unwatched_files_should_be_removed'
     1613:       waiting(20) { sleep 0.1 until Dir.glob("#{@tmp_dir}/*.txt").size == 0 } # Ensure file is deleted on Windows
     1614:       waiting(5) { sleep 0.1 until d.instance.instance_variable_get(:@tails).keys.size <= 0 }
     1615: 
  => 1616:       assert_equal(
     1617:         {
     1618:           files: [],
     1619:           tails: []
<{:files=>[], :tails=>[]}> expected but was
<{:files=>[],
 :tails=>
  ["/Users/runner/work/fluentd/fluentd/test/plugin/../tmp/tail/dcebe801d2a39d7ba0fc/tail.txt"]}>

diff:
? {:files=>[], :tails=>[]}
+  :tails=>
+   ["/Users/runner/work/fluentd/fluentd/test/plugin/../tmp/tail/dcebe801d2a39d7ba0fc/tail.txt"]}

https://github.com/fluent/fluentd/blob/8e9f46ae84e6fd603cf46c63cdef6f3b2334cca3/test/plugin/test_in_tail.rb#L1597-L1638

To Reproduce

I can't reproduce this on my local yet.

In CI, I have confirmed this on Ruby 2.7 on macos-latest.

Not sure if this is related to Ruby version or OS.

Expected behavior

The test always succeeds.

Your Environment

None

Your Configuration

None

Your Error Log

None

Additional context

No response

daipom avatar Mar 03 '23 05:03 daipom

I have tested it on my local Mac and it does not seem to reproduce.

% sw_vers
ProductName:        macOS
ProductVersion:     13.2.1
BuildVersion:       22D68
% ruby -v
ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-darwin22]

abetomo avatar Mar 03 '23 14:03 abetomo

@abetomo Thanks!! It doesn't seem to happen very often on CI. Maybe this rarely occurs.

daipom avatar Mar 04 '23 14:03 daipom