Skip to content

Commit

Permalink
Merge pull request #3577 from fluent/fix-staled-tests-on-ruby3.1
Browse files Browse the repository at this point in the history
test: Fix stalled tests on Ruby 3.1
  • Loading branch information
ashie authored Dec 21, 2021
2 parents c7a2cf0 + 2c3e6c1 commit 85ff1a3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/plugin/test_bare_output.rb
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 85ff1a3

Please sign in to comment.