mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Switch to using one socket
This commit is contained in:
parent
b63cde62c0
commit
f3907ede13
1 changed files with 4 additions and 6 deletions
|
@ -76,7 +76,7 @@ describe "inputs/tcp" do
|
||||||
output = Shiftback.new do |event|
|
output = Shiftback.new do |event|
|
||||||
sequence += 1
|
sequence += 1
|
||||||
begin
|
begin
|
||||||
insist { event.message } == "Hello ü Û"
|
insist { event.message } == "Hello ü Û\n"
|
||||||
insist { event.message.encoding } == Encoding.find("UTF-8")
|
insist { event.message.encoding } == Encoding.find("UTF-8")
|
||||||
rescue Exception => failure
|
rescue Exception => failure
|
||||||
# Get out of the threads nets
|
# Get out of the threads nets
|
||||||
|
@ -93,13 +93,11 @@ describe "inputs/tcp" do
|
||||||
tcp.run(output)
|
tcp.run(output)
|
||||||
end
|
end
|
||||||
#Send events from clients sockets
|
#Send events from clients sockets
|
||||||
event_count.times do |value|
|
|
||||||
client_socket = TCPSocket.new("0.0.0.0", port)
|
client_socket = TCPSocket.new("0.0.0.0", port)
|
||||||
client_socket.write "Hello ü Û"
|
event_count.times do |value|
|
||||||
client_socket.close
|
client_socket.write "Hello ü Û\n"
|
||||||
# micro sleep to ensure sequencing
|
|
||||||
sleep(0.1)
|
|
||||||
end
|
end
|
||||||
|
client_socket.close
|
||||||
#wait for input termination
|
#wait for input termination
|
||||||
puts "Waiting for tcp input thread to finish"
|
puts "Waiting for tcp input thread to finish"
|
||||||
thread.join
|
thread.join
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue