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

Clean up after unit tests #4050

Merged
merged 5 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion lib/fluent/test/driver/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def instance_shutdown(log: Logger.new($stdout))

if @socket_manager_server
@socket_manager_server.close
if @socket_manager_server.is_a?(String) && File.exist?(@socket_manager_path)
if @socket_manager_path.is_a?(String) && File.exist?(@socket_manager_path)
ashie marked this conversation as resolved.
Show resolved Hide resolved
FileUtils.rm_f @socket_manager_path
end
end
Expand Down
2 changes: 2 additions & 0 deletions test/plugin/test_in_tcp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def create_tcp_socket(host, port, &block)

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

d.instance_shutdown
ashie marked this conversation as resolved.
Show resolved Hide resolved
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/plugin_helper/test_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Dummy < Fluent::Plugin::TestBase
(@d.terminated? || @d.terminate) rescue nil

@socket_manager_server.close
if @socket_manager_server.is_a?(String) && File.exist?(@socket_manager_path)
if @socket_manager_path.is_a?(String) && File.exist?(@socket_manager_path)
FileUtils.rm_f @socket_manager_path
end
end
Expand Down