Skip to content

Commit

Permalink
change content value
Browse files Browse the repository at this point in the history
Testing with Fileutils.touch needs to call `sleep` to change the value of
mtime

Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
  • Loading branch information
ganmacs committed Feb 3, 2020
1 parent bff27ea commit 8946e53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/plugin/in_tail/test_position_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ def write_data(f, content)
pf = Fluent::Plugin::TailInput::PositionFile.new(@file, logger: $log)

mock.proxy(pf).fetch_compacted_entries do |r|
FileUtils.touch(@file.path) # change mtime
@file.write("unwatched\t#{UNWATCHED_STR}\t0000000000000000\n")
r
end

pf.try_compact

@file.seek(0)
lines = @file.readlines
assert_equal 4, lines.size
assert_equal 5, lines.size
end
end

Expand Down

0 comments on commit 8946e53

Please sign in to comment.