Skip to content

Commit

Permalink
Merge pull request #4138 from daipom/refactor-in_tcp-tests
Browse files Browse the repository at this point in the history
Test `in_tcp`: Fix undesirable way to assert logs
  • Loading branch information
ashie authored Apr 13, 2023
2 parents 81513ed + fc985ea commit 8112d8f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/plugin/test_in_tcp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,14 @@ def create_tcp_socket(host, port, &block)
</client>
</security>
!)
d.run(shutdown: false, expect_records: 1, timeout: 2) do
d.run(expect_records: 1, timeout: 2) do
create_tcp_socket('127.0.0.1', @port) do |sock|
sock.send("hello\n", 0)
end
end

assert_equal 1, d.instance.log.logs.count { |l| l =~ /anonymous client/ }
assert_equal 1, d.logs.count { |l| l =~ /anonymous client/ }
assert_equal 0, d.events.size
ensure
d.instance_shutdown if d&.instance
end
end

Expand Down

0 comments on commit 8112d8f

Please sign in to comment.