Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix stalled tests on Ruby 3.1 #3577

Merged
merged 1 commit into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/plugin/test_bare_output.rb
Expand Up @@ -83,7 +83,7 @@ class BareOutputTest < Test::Unit::TestCase

@p.configure(config_element('ROOT', '', {'@log_level' => 'debug'}))

assert{ @p.log.object_id != original_logger.object_id }
assert(@p.log.object_id != original_logger.object_id)
assert_equal Fluent::Log::LEVEL_DEBUG, @p.log.level
end

Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_filter.rb
Expand Up @@ -153,7 +153,7 @@ def emit_error_event(tag, time, record, error)

@p.configure(config_element('ROOT', '', {'@log_level' => 'debug'}))

assert{ @p.log.object_id != original_logger.object_id }
assert(@p.log.object_id != original_logger.object_id)
assert_equal Fluent::Log::LEVEL_DEBUG, @p.log.level
end

Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_input.rb
Expand Up @@ -73,7 +73,7 @@ class InputTest < Test::Unit::TestCase

@p.configure(config_element('ROOT', '', {'@log_level' => 'debug'}))

assert{ @p.log.object_id != original_logger.object_id }
assert(@p.log.object_id != original_logger.object_id)
assert_equal Fluent::Log::LEVEL_DEBUG, @p.log.level
end

Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_output_as_buffered_secondary.rb
Expand Up @@ -775,7 +775,7 @@ def dummy_event_stream
assert_equal [ 'test.tag.1', event_time('2016-04-13 18:33:13').to_i, {"name" => "moris", "age" => 36, "message" => "data2"} ], written[1]
assert_equal [ 'test.tag.1', event_time('2016-04-13 18:33:32').to_i, {"name" => "moris", "age" => 36, "message" => "data3"} ], written[2]

assert{ @i.log.out.logs.any?{|l| l.include?("[warn]: retry succeeded by secondary.") } }
assert(@i.log.out.logs.any?{|l| l.include?("[warn]: retry succeeded by secondary.") })
end

test 'exponential backoff interval will be initialized when switched to secondary' do
Expand Down
4 changes: 2 additions & 2 deletions test/plugin_helper/test_timer.rb
Expand Up @@ -90,8 +90,8 @@ class Dummy < Fluent::Plugin::TestBase
assert{ counter1 >= 4 && counter1 <= 5 }
assert{ counter2 == 2 }
msg = "Unexpected error raised. Stopping the timer. title=:t2"
assert{ d1.log.out.logs.any?{|line| line.include?("[error]:") && line.include?(msg) && line.include?("abort!!!!!!") } }
assert{ d1.log.out.logs.any?{|line| line.include?("[error]:") && line.include?("Timer detached. title=:t2") } }
assert(d1.log.out.logs.any?{|line| line.include?("[error]:") && line.include?(msg) && line.include?("abort!!!!!!") })
assert(d1.log.out.logs.any?{|line| line.include?("[error]:") && line.include?("Timer detached. title=:t2") })

d1.shutdown; d1.close; d1.terminate
end
Expand Down