@@ -2704,22 +2704,14 @@ def test_updateTW_before_refreshTW_and_detach_before_refreshTW
2704
2704
2705
2705
assert_equal (
2706
2706
{
2707
- # TODO: This is BUG!! We need to fix it and replace this with the next.
2708
- record_values : [ "file1 log1" , "file1 log1" , "file1 log2" , "file1 log2" , "file2 log1" , "file2 log2" ] ,
2709
- # record_values: ["file1 log1", "file1 log2", "file2 log1", "file2 log2"],
2707
+ record_values : [ "file1 log1" , "file1 log2" , "file2 log1" , "file2 log2" ] ,
2710
2708
tail_watcher_paths : [ "#{ @tmp_dir } /tail.txt" , "#{ @tmp_dir } /tail.txt" , "#{ @tmp_dir } /tail.txt1" ] ,
2711
2709
tail_watcher_inodes : [ inode_0 , inode_1 , inode_0 ] ,
2712
2710
tail_watcher_io_handler_opened_statuses : [ false , false , false ] ,
2713
- # TODO: This is BUG!! We need to fix it and replace this with the next.
2714
2711
position_entries : [
2715
- [ "#{ @tmp_dir } /tail.txt" , "ffffffffffffffff " , inode_0 ] ,
2712
+ [ "#{ @tmp_dir } /tail.txt" , "0000000000000016 " , inode_0 ] ,
2716
2713
[ "#{ @tmp_dir } /tail.txt" , "0000000000000016" , inode_1 ] ,
2717
- [ "#{ @tmp_dir } /tail.txt1" , "0000000000000016" , inode_0 ] ,
2718
2714
] ,
2719
- # position_entries: [
2720
- # ["#{@tmp_dir}/tail.txt", "ffffffffffffffff", inode_0],
2721
- # ["#{@tmp_dir}/tail.txt", "0000000000000016", inode_1],
2722
- # ],
2723
2715
} ,
2724
2716
{
2725
2717
record_values : record_values ,
@@ -2802,7 +2794,8 @@ def test_updateTW_before_refreshTW_and_detach_after_refreshTW
2802
2794
tail_watcher_inodes : [ inode_0 , inode_1 , inode_0 ] ,
2803
2795
tail_watcher_io_handler_opened_statuses : [ false , false , false ] ,
2804
2796
position_entries : [
2805
- [ "#{ @tmp_dir } /tail.txt" , "ffffffffffffffff" , inode_0 ] ,
2797
+ # The recorded path is old, but it is no problem. The path is not used when using follow_inodes.
2798
+ [ "#{ @tmp_dir } /tail.txt" , "0000000000000016" , inode_0 ] ,
2806
2799
[ "#{ @tmp_dir } /tail.txt" , "0000000000000016" , inode_1 ] ,
2807
2800
] ,
2808
2801
} ,
@@ -2861,8 +2854,9 @@ def test_updateTW_after_refreshTW
2861
2854
# This overwrites `@tails["tail.txt"]`
2862
2855
d . instance . refresh_watchers
2863
2856
2864
- # `watch_timer` calls `TailWatcher::on_notify`, and then `update_watcher` updates the TailWatcher:
2857
+ # `watch_timer` calls `TailWatcher::on_notify`, and then `update_watcher` trys to update the TailWatcher:
2865
2858
# TailWatcher(path: "tail.txt", inode: inode_0) => TailWatcher(path: "tail.txt", inode: inode_1)
2859
+ # However, it is already added in `refresh_watcher`, so `update_watcher` doesn't create the new TailWatcher.
2866
2860
# The old TailWathcer is detached here since `rotate_wait` is just `1s`.
2867
2861
sleep 3
2868
2862
@@ -2886,22 +2880,15 @@ def test_updateTW_after_refreshTW
2886
2880
2887
2881
assert_equal (
2888
2882
{
2889
- # TODO: This is BUG!! We need to fix it and replace this with the next.
2890
- record_values : [ "file1 log1" , "file1 log1" , "file1 log2" , "file1 log2" , "file2 log1" , "file2 log2" ] ,
2891
- # record_values: ["file1 log1", "file1 log2", "file2 log1", "file2 log2"],
2883
+ record_values : [ "file1 log1" , "file1 log2" , "file2 log1" , "file2 log2" ] ,
2892
2884
tail_watcher_paths : [ "#{ @tmp_dir } /tail.txt" , "#{ @tmp_dir } /tail.txt" , "#{ @tmp_dir } /tail.txt1" ] ,
2893
2885
tail_watcher_inodes : [ inode_0 , inode_1 , inode_0 ] ,
2894
2886
tail_watcher_io_handler_opened_statuses : [ false , false , false ] ,
2895
- # TODO: This is BUG!! We need to fix it and replace this with the next.
2896
2887
position_entries : [
2897
- [ "#{ @tmp_dir } /tail.txt" , "ffffffffffffffff" , inode_0 ] ,
2888
+ # The recorded path is old, but it is no problem. The path is not used when using follow_inodes.
2889
+ [ "#{ @tmp_dir } /tail.txt" , "0000000000000016" , inode_0 ] ,
2898
2890
[ "#{ @tmp_dir } /tail.txt" , "0000000000000016" , inode_1 ] ,
2899
- [ "#{ @tmp_dir } /tail.txt1" , "0000000000000016" , inode_0 ] ,
2900
2891
] ,
2901
- # position_entries: [
2902
- # ["#{@tmp_dir}/tail.txt", "ffffffffffffffff", inode_0],
2903
- # ["#{@tmp_dir}/tail.txt", "0000000000000016", inode_1],
2904
- # ],
2905
2892
} ,
2906
2893
{
2907
2894
record_values : record_values ,
0 commit comments