Commit a1ea952b authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

fixing the counter of created channels/messages

parent 814f76b9
...@@ -22,11 +22,12 @@ class TestCreateManyChannels < Test::Unit::TestCase ...@@ -22,11 +22,12 @@ class TestCreateManyChannels < Test::Unit::TestCase
i = 0 i = 0
EM.add_periodic_timer(0.05) do EM.add_periodic_timer(0.05) do
i += 1
pub_1 = EventMachine::HttpRequest.new(nginx_address + '/pub?id=' + channel.to_s).post :head => headers, :body => body, :timeout => 60 pub_1 = EventMachine::HttpRequest.new(nginx_address + '/pub?id=' + channel.to_s).post :head => headers, :body => body, :timeout => 60
pub_1.callback { pub_1.callback {
if pub_1.response_header.status == 500 if pub_1.response_header.status == 500
EventMachine.stop EventMachine.stop
else
i += 1
end end
} }
fail_if_connecttion_error(pub_1) fail_if_connecttion_error(pub_1)
...@@ -85,11 +86,12 @@ class TestCreateManyChannels < Test::Unit::TestCase ...@@ -85,11 +86,12 @@ class TestCreateManyChannels < Test::Unit::TestCase
i = 0 i = 0
EventMachine.run { EventMachine.run {
EM.add_periodic_timer(0.05) do EM.add_periodic_timer(0.05) do
i += 1
pub_1 = EventMachine::HttpRequest.new(nginx_address + '/pub?id=' + channel.to_s + i.to_s).post :head => headers, :body => body, :timeout => 60 pub_1 = EventMachine::HttpRequest.new(nginx_address + '/pub?id=' + channel.to_s + i.to_s).post :head => headers, :body => body, :timeout => 60
pub_1.callback { pub_1.callback {
if pub_1.response_header.status == 500 if pub_1.response_header.status == 500
EventMachine.stop EventMachine.stop
else
i += 1
end end
} }
fail_if_connecttion_error(pub_1) fail_if_connecttion_error(pub_1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment