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 in_tcp: Fix undesirable way to assert logs #4138

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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