Skip to content

Commit

Permalink
test_in_tail: Fix an inappropriate config name
Browse files Browse the repository at this point in the history
CONFIG_ENABLE_WATCH_TIMER ->
CONFIG_DISABLE_WATCH_TIMER

The tests that use above config are intended to disable watch timer.

Signed-off-by: Takuro Ashie <[email protected]>
  • Loading branch information
ashie committed Nov 1, 2021
1 parent 6978442 commit 1dae546
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/plugin/test_in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def create_target_info(path)
})
COMMON_CONFIG = CONFIG + config_element("", "", { "pos_file" => "#{TMP_DIR}/tail.pos" })
CONFIG_READ_FROM_HEAD = config_element("", "", { "read_from_head" => true })
CONFIG_ENABLE_WATCH_TIMER = config_element("", "", { "enable_watch_timer" => false })
CONFIG_DISABLE_WATCH_TIMER = config_element("", "", { "enable_watch_timer" => false })
CONFIG_DISABLE_STAT_WATCHER = config_element("", "", { "enable_stat_watcher" => false })
CONFIG_OPEN_ON_EVERY_UPDATE = config_element("", "", { "open_on_every_update" => true })
COMMON_FOLLOW_INODE_CONFIG = config_element("ROOT", "", {
Expand Down Expand Up @@ -199,7 +199,7 @@ def create_driver(conf = SINGLE_LINE_CONFIG, use_common_conf = true)

sub_test_case "log throttling per file" do
test "w/o watcher timer is invalid" do
conf = CONFIG_ENABLE_WATCH_TIMER + config_element("ROOT", "", {"read_bytes_limit_per_second" => "8k"})
conf = CONFIG_DISABLE_WATCH_TIMER + config_element("ROOT", "", {"read_bytes_limit_per_second" => "8k"})
assert_raise(Fluent::ConfigError) do
create_driver(conf)
end
Expand All @@ -215,7 +215,7 @@ def create_driver(conf = SINGLE_LINE_CONFIG, use_common_conf = true)

test "both enable_watch_timer and enable_stat_watcher are false" do
assert_raise(Fluent::ConfigError) do
create_driver(CONFIG_ENABLE_WATCH_TIMER + CONFIG_DISABLE_STAT_WATCHER + PARSE_SINGLE_LINE_CONFIG)
create_driver(CONFIG_DISABLE_WATCH_TIMER + CONFIG_DISABLE_STAT_WATCHER + PARSE_SINGLE_LINE_CONFIG)
end
end

Expand Down Expand Up @@ -570,9 +570,9 @@ def test_emit_with_read_from_head(data)
assert_equal({"message" => "test4"}, events[3][2])
end

data(flat: CONFIG_ENABLE_WATCH_TIMER + SINGLE_LINE_CONFIG,
parse: CONFIG_ENABLE_WATCH_TIMER + PARSE_SINGLE_LINE_CONFIG)
def test_emit_with_enable_watch_timer(data)
data(flat: CONFIG_DISABLE_WATCH_TIMER + SINGLE_LINE_CONFIG,
parse: CONFIG_DISABLE_WATCH_TIMER + PARSE_SINGLE_LINE_CONFIG)
def test_emit_without_watch_timer(data)
config = data
File.open("#{TMP_DIR}/tail.txt", "wb") {|f|
f.puts "test1"
Expand Down

0 comments on commit 1dae546

Please sign in to comment.