Skip to content

Commit a877c9f

Browse files
committed
improve tests
1 parent 5ee1184 commit a877c9f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/logstash/outputs/tcp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def connect
325325
client_socket.post_connection_check(@host) if @ssl_verification_mode == 'full'
326326
rescue OpenSSL::SSL::SSLError => ssle
327327
log_error 'connect ssl failure:', ssle, backtrace: false
328-
client_socket.close
328+
client_socket.close rescue nil
329329
raise
330330
end
331331
end

spec/outputs/tcp_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
let(:config) { super().merge("host" => "127.0.0.1") }
277277
it 'closes the connection' do
278278
thread = Thread.start do
279-
sleep 1.25
279+
sleep 0.1
280280
expect { subject.connect }.to raise_error(OpenSSL::SSL::SSLError, /hostname "127.0.0.1" does not match the server certificate/)
281281
end
282282
socket = secure_server.accept

0 commit comments

Comments
 (0)