Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
bdbe3706
Commit
bdbe3706
authored
May 30, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speedup some tests
parent
d3c644bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
test_create_many_channels.rb
test/test_create_many_channels.rb
+2
-5
test_publish_messages.rb
test/test_publish_messages.rb
+2
-1
test_publisher.rb
test/test_publisher.rb
+1
-1
No files found.
test/test_create_many_channels.rb
View file @
bdbe3706
...
...
@@ -10,12 +10,11 @@ class TestCreateManyChannels < Test::Unit::TestCase
def
test_create_many_channels
headers
=
{
'accept'
=>
'application/json'
}
body
=
'channel started'
channels_to_be_created
=
200
channels_callback
=
0
;
channels_to_be_created
=
4000
EventMachine
.
run
{
i
=
0
EM
.
add_periodic_timer
(
0.0
5
)
do
EM
.
add_periodic_timer
(
0.0
01
)
do
i
+=
1
if
i
<=
channels_to_be_created
pub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/pub?id=ch_test_create_many_channels_'
+
i
.
to_s
).
post
:head
=>
headers
,
:body
=>
body
,
:timeout
=>
30
...
...
@@ -23,9 +22,7 @@ class TestCreateManyChannels < Test::Unit::TestCase
if
pub
.
response_header
.
status
!=
200
assert_equal
(
200
,
pub
.
response_header
.
status
,
"Channel was not created: ch_test_create_many_channels_"
+
i
.
to_s
)
end
channels_callback
+=
1
}
fail_if_connecttion_error
(
pub
)
else
EventMachine
.
stop
end
...
...
test/test_publish_messages.rb
View file @
bdbe3706
...
...
@@ -30,6 +30,7 @@ class TestPublishMessages < Test::Unit::TestCase
@header_template
=
nil
@message_template
=
"~text~"
@max_reserved_memory
=
"256m"
@ping_message_interval
=
nil
end
def
test_publish_many_messages_in_the_same_channel
...
...
@@ -53,7 +54,7 @@ class TestPublishMessages < Test::Unit::TestCase
fail_if_connecttion_error
(
sub
)
i
=
0
EM
.
add_periodic_timer
(
0.0
5
)
do
EM
.
add_periodic_timer
(
0.0
01
)
do
i
+=
1
if
i
<=
messagens_to_publish
pub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/pub?id='
+
channel
.
to_s
).
post
:head
=>
headers
,
:body
=>
body_prefix
+
i
.
to_s
,
:timeout
=>
30
...
...
test/test_publisher.rb
View file @
bdbe3706
...
...
@@ -269,7 +269,7 @@ class TestPublisher < Test::Unit::TestCase
i
=
0
stored_messages
=
0
EM
.
add_periodic_timer
(
0.0
5
)
do
EM
.
add_periodic_timer
(
0.0
01
)
do
i
+=
1
if
i
<=
messagens_to_publish
pub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/pub?id='
+
channel
.
to_s
).
post
:head
=>
headers
,
:body
=>
body_prefix
+
i
.
to_s
,
:timeout
=>
30
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment