Skip to content

Fix an unstable test of in_tail (especially on macOS)#3314

Merged
ashie merged 1 commit into
fluent:masterfrom
ashie:fix-unstable-test-on-mac
Apr 2, 2021
Merged

Fix an unstable test of in_tail (especially on macOS)#3314
ashie merged 1 commit into
fluent:masterfrom
ashie:fix-unstable-test-on-mac

Conversation

@ashie

@ashie ashie commented Apr 2, 2021

Copy link
Copy Markdown
Member

Which issue(s) this PR fixes:
none

What this PR does / why we need it:
This commit try to fix the following failure:

  2021-04-02T00:47:45.1133120Z Failure: test_truncate_file(TailInputTest)
  2021-04-02T00:47:45.1140150Z /Users/runner/work/fluentd/fluentd/test/plugin/test_in_tail.rb:606:in `test_truncate_file'
  2021-04-02T00:47:45.1140850Z      603:     end
  2021-04-02T00:47:45.1141130Z      604:
  2021-04-02T00:47:45.1141450Z      605:     events = d.events
  2021-04-02T00:47:45.1141920Z   => 606:     assert_equal(3, events.length)
  2021-04-02T00:47:45.1142440Z      607:     assert_equal({"message" => "test3"}, events[0][2])
  2021-04-02T00:47:45.1142960Z      608:     assert_equal({"message" => "test4"}, events[1][2])
  2021-04-02T00:47:45.1143490Z      609:     assert_equal({"message" => "test1"}, events[2][2])
  2021-04-02T00:47:45.1143940Z <3> expected but was
  2021-04-02T00:47:45.1144370Z <1>

sleep time 1sec may too short when inotify isn't available or high load situation.

Docs Changes:
none

Release Note:
none

This commit try to fix the following failure:

  2021-04-02T00:47:45.1133120Z Failure: test_truncate_file(TailInputTest)
  2021-04-02T00:47:45.1140150Z /Users/runner/work/fluentd/fluentd/test/plugin/test_in_tail.rb:606:in `test_truncate_file'
  2021-04-02T00:47:45.1140850Z      603:     end
  2021-04-02T00:47:45.1141130Z      604:
  2021-04-02T00:47:45.1141450Z      605:     events = d.events
  2021-04-02T00:47:45.1141920Z   => 606:     assert_equal(3, events.length)
  2021-04-02T00:47:45.1142440Z      607:     assert_equal({"message" => "test3"}, events[0][2])
  2021-04-02T00:47:45.1142960Z      608:     assert_equal({"message" => "test4"}, events[1][2])
  2021-04-02T00:47:45.1143490Z      609:     assert_equal({"message" => "test1"}, events[2][2])
  2021-04-02T00:47:45.1143940Z <3> expected but was
  2021-04-02T00:47:45.1144370Z <1>

sleep time 1sec may too short when inotify isn't available or high load
situation.

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
@ashie

ashie commented Apr 2, 2021

Copy link
Copy Markdown
Member Author

It seems become stable.

@ashie ashie merged commit f03611d into fluent:master Apr 2, 2021
@ashie ashie deleted the fix-unstable-test-on-mac branch April 2, 2021 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant