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
63dcebcc
Commit
63dcebcc
authored
Jul 29, 2013
by
Wandenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change test to use default cleanup objects ttl
parent
42ebbfb9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
13 deletions
+12
-13
cleanup_memory_spec.rb
misc/spec/mix/cleanup_memory_spec.rb
+11
-9
measure_memory_spec.rb
misc/spec/mix/measure_memory_spec.rb
+0
-1
send_signals_spec.rb
misc/spec/mix/send_signals_spec.rb
+0
-1
nginx_configuration.rb
misc/spec/nginx_configuration.rb
+1
-1
properties_spec.rb
misc/spec/publisher/properties_spec.rb
+0
-1
No files found.
misc/spec/mix/cleanup_memory_spec.rb
View file @
63dcebcc
...
@@ -19,7 +19,7 @@ describe "Cleanup Memory" do
...
@@ -19,7 +19,7 @@ describe "Cleanup Memory" do
it
"should cleanup memory used for published message"
,
:cleanup
=>
true
do
it
"should cleanup memory used for published message"
,
:cleanup
=>
true
do
channel
=
'ch_test_message_cleanup'
channel
=
'ch_test_message_cleanup'
body
=
'message to create a channel'
body
=
'message to create a channel'
expected_time_for_clear
=
4
5
expected_time_for_clear
=
2
5
nginx_run_server
(
config
.
merge
(
:max_messages_stored_per_channel
=>
100
),
:timeout
=>
test_timeout
)
do
|
conf
|
nginx_run_server
(
config
.
merge
(
:max_messages_stored_per_channel
=>
100
),
:timeout
=>
test_timeout
)
do
|
conf
|
stored_messages_setp_1
=
0
stored_messages_setp_1
=
0
...
@@ -140,7 +140,7 @@ describe "Cleanup Memory" do
...
@@ -140,7 +140,7 @@ describe "Cleanup Memory" do
it
"should cleanup message memory without max messages stored per channelXXX"
,
:cleanup
=>
true
do
it
"should cleanup message memory without max messages stored per channelXXX"
,
:cleanup
=>
true
do
channel
=
'ch_test_message_cleanup_without_max_messages_stored_per_chann'
channel
=
'ch_test_message_cleanup_without_max_messages_stored_per_chann'
body
=
'message to create a channel'
body
=
'message to create a channel'
expected_time_for_clear
=
4
5
expected_time_for_clear
=
2
5
nginx_run_server
(
config
,
:timeout
=>
test_timeout
)
do
|
conf
|
nginx_run_server
(
config
,
:timeout
=>
test_timeout
)
do
|
conf
|
stored_messages_setp_1
=
0
stored_messages_setp_1
=
0
...
@@ -185,6 +185,7 @@ describe "Cleanup Memory" do
...
@@ -185,6 +185,7 @@ describe "Cleanup Memory" do
fill_memory_timer
=
EventMachine
::
PeriodicTimer
.
new
(
0.001
)
do
fill_memory_timer
=
EventMachine
::
PeriodicTimer
.
new
(
0.001
)
do
publish_message_inline_with_callbacks
(
channel
,
headers
,
body
,
{
publish_message_inline_with_callbacks
(
channel
,
headers
,
body
,
{
:error
=>
Proc
.
new
do
|
status3
,
content3
|
:error
=>
Proc
.
new
do
|
status3
,
content3
|
fill_memory_timer
.
cancel
pub_4
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats?id='
+
channel
.
to_s
).
get
:head
=>
headers
pub_4
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats?id='
+
channel
.
to_s
).
get
:head
=>
headers
pub_4
.
callback
do
pub_4
.
callback
do
pub_4
.
should
be_http_status
(
200
).
with_body
pub_4
.
should
be_http_status
(
200
).
with_body
...
@@ -219,7 +220,7 @@ describe "Cleanup Memory" do
...
@@ -219,7 +220,7 @@ describe "Cleanup Memory" do
channels_setp_1
=
0
channels_setp_1
=
0
channels_setp_2
=
0
channels_setp_2
=
0
published_messages_setp_1
=
0
published_messages_setp_1
=
0
expected_time_for_clear
=
6
5
expected_time_for_clear
=
4
5
EventMachine
.
run
do
EventMachine
.
run
do
i
=
0
i
=
0
...
@@ -285,7 +286,7 @@ describe "Cleanup Memory" do
...
@@ -285,7 +286,7 @@ describe "Cleanup Memory" do
it
"should cleanup memory used for publish messages with store 'off' and with subscriber"
,
:cleanup
=>
true
do
it
"should cleanup memory used for publish messages with store 'off' and with subscriber"
,
:cleanup
=>
true
do
channel
=
'ch_test_message_cleanup_with_store_off_with_subscriber'
channel
=
'ch_test_message_cleanup_with_store_off_with_subscriber'
body
=
'message to create a channel'
body
=
'message to create a channel'
expected_time_for_clear
=
3
5
expected_time_for_clear
=
1
5
nginx_run_server
(
config
.
merge
(
:store_messages
=>
'off'
),
:timeout
=>
test_timeout
)
do
|
conf
|
nginx_run_server
(
config
.
merge
(
:store_messages
=>
'off'
),
:timeout
=>
test_timeout
)
do
|
conf
|
published_messages_setp_1
=
0
published_messages_setp_1
=
0
...
@@ -326,6 +327,7 @@ describe "Cleanup Memory" do
...
@@ -326,6 +327,7 @@ describe "Cleanup Memory" do
fill_memory_timer
=
EventMachine
::
PeriodicTimer
.
new
(
0.001
)
do
fill_memory_timer
=
EventMachine
::
PeriodicTimer
.
new
(
0.001
)
do
publish_message_inline_with_callbacks
(
channel
,
headers
,
body
,
{
publish_message_inline_with_callbacks
(
channel
,
headers
,
body
,
{
:error
=>
Proc
.
new
do
|
status3
,
content3
|
:error
=>
Proc
.
new
do
|
status3
,
content3
|
fill_memory_timer
.
cancel
pub_4
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats?id='
+
channel
.
to_s
).
get
:head
=>
headers
pub_4
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats?id='
+
channel
.
to_s
).
get
:head
=>
headers
pub_4
.
callback
do
pub_4
.
callback
do
pub_4
.
should
be_http_status
(
200
).
with_body
pub_4
.
should
be_http_status
(
200
).
with_body
...
@@ -354,7 +356,7 @@ describe "Cleanup Memory" do
...
@@ -354,7 +356,7 @@ describe "Cleanup Memory" do
it
"should cleanup memory used for publish messages with store 'off' and without subscriber"
,
:cleanup
=>
true
do
it
"should cleanup memory used for publish messages with store 'off' and without subscriber"
,
:cleanup
=>
true
do
channel
=
'ch_test_message_cleanup_with_store_off_without_subscriber'
channel
=
'ch_test_message_cleanup_with_store_off_without_subscriber'
body
=
'message to create a channel'
body
=
'message to create a channel'
expected_time_for_clear
=
6
5
expected_time_for_clear
=
4
5
nginx_run_server
(
config
.
merge
(
:store_messages
=>
'off'
),
:timeout
=>
test_timeout
)
do
|
conf
|
nginx_run_server
(
config
.
merge
(
:store_messages
=>
'off'
),
:timeout
=>
test_timeout
)
do
|
conf
|
published_messages_setp_1
=
0
published_messages_setp_1
=
0
...
@@ -374,7 +376,7 @@ describe "Cleanup Memory" do
...
@@ -374,7 +376,7 @@ describe "Cleanup Memory" do
published_messages_setp_1
=
result
[
"published_messages"
].
to_i
published_messages_setp_1
=
result
[
"published_messages"
].
to_i
execute_changes_on_environment
(
conf
)
do
execute_changes_on_environment
(
conf
)
do
wait_until_trash_is_empty
(
start
,
expected_time_for_clear
,
{
:check_stored_messages
=>
true
})
do
wait_until_trash_is_empty
(
start
,
expected_time_for_clear
,
{
:check_stored_messages
=>
true
,
:check_channels
=>
true
})
do
j
=
0
j
=
0
fill_memory_timer
=
EventMachine
::
PeriodicTimer
.
new
(
0.001
)
do
fill_memory_timer
=
EventMachine
::
PeriodicTimer
.
new
(
0.001
)
do
publish_message_inline_with_callbacks
(
channel
+
j
.
to_s
,
headers
,
body
,
{
publish_message_inline_with_callbacks
(
channel
+
j
.
to_s
,
headers
,
body
,
{
...
@@ -391,6 +393,7 @@ describe "Cleanup Memory" do
...
@@ -391,6 +393,7 @@ describe "Cleanup Memory" do
fill_memory_timer
=
EventMachine
::
PeriodicTimer
.
new
(
0.001
)
do
fill_memory_timer
=
EventMachine
::
PeriodicTimer
.
new
(
0.001
)
do
publish_message_inline_with_callbacks
(
channel
+
i
.
to_s
,
headers
,
body
,
{
publish_message_inline_with_callbacks
(
channel
+
i
.
to_s
,
headers
,
body
,
{
:error
=>
Proc
.
new
do
|
status3
,
content3
|
:error
=>
Proc
.
new
do
|
status3
,
content3
|
fill_memory_timer
.
cancel
pub_4
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats'
).
get
:head
=>
headers
pub_4
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats'
).
get
:head
=>
headers
pub_4
.
callback
do
pub_4
.
callback
do
pub_4
.
should
be_http_status
(
200
).
with_body
pub_4
.
should
be_http_status
(
200
).
with_body
...
@@ -422,7 +425,7 @@ describe "Cleanup Memory" do
...
@@ -422,7 +425,7 @@ describe "Cleanup Memory" do
it
"should cleanup memory used after delete created channels"
,
:cleanup
=>
true
do
it
"should cleanup memory used after delete created channels"
,
:cleanup
=>
true
do
channel
=
'ch_test_channel_cleanup_after_delete'
channel
=
'ch_test_channel_cleanup_after_delete'
body
=
'message to create a channel'
body
=
'message to create a channel'
expected_time_for_clear
=
3
5
expected_time_for_clear
=
1
5
nginx_run_server
(
config
.
merge
(
:publisher_mode
=>
'admin'
),
:timeout
=>
test_timeout
)
do
|
conf
|
nginx_run_server
(
config
.
merge
(
:publisher_mode
=>
'admin'
),
:timeout
=>
test_timeout
)
do
|
conf
|
published_messages_setp_1
=
0
published_messages_setp_1
=
0
...
@@ -478,7 +481,7 @@ describe "Cleanup Memory" do
...
@@ -478,7 +481,7 @@ describe "Cleanup Memory" do
it
"should cleanup memory used after delete created channels with same id"
,
:cleanup
=>
true
do
it
"should cleanup memory used after delete created channels with same id"
,
:cleanup
=>
true
do
channel
=
'ch_test_channel_cleanup_after_delete_same_id'
channel
=
'ch_test_channel_cleanup_after_delete_same_id'
body
=
'message to create a channel'
body
=
'message to create a channel'
expected_time_for_clear
=
35
expected_time_for_clear
=
10
nginx_run_server
(
config
.
merge
(
:publisher_mode
=>
'admin'
),
:timeout
=>
test_timeout
)
do
|
conf
|
nginx_run_server
(
config
.
merge
(
:publisher_mode
=>
'admin'
),
:timeout
=>
test_timeout
)
do
|
conf
|
published_messages_setp_1
=
0
published_messages_setp_1
=
0
...
@@ -564,7 +567,6 @@ describe "Cleanup Memory" do
...
@@ -564,7 +567,6 @@ describe "Cleanup Memory" do
{
{
:master_process
=>
'on'
,
:master_process
=>
'on'
,
:daemon
=>
'on'
,
:daemon
=>
'on'
,
:shared_memory_cleanup_objects_ttl
=>
'30s'
,
:shared_memory_size
=>
"129k"
,
:shared_memory_size
=>
"129k"
,
:message_ttl
=>
'10s'
,
:message_ttl
=>
'10s'
,
:max_messages_stored_per_channel
=>
nil
:max_messages_stored_per_channel
=>
nil
...
...
misc/spec/mix/measure_memory_spec.rb
View file @
63dcebcc
...
@@ -4,7 +4,6 @@ describe "Measure Memory" do
...
@@ -4,7 +4,6 @@ describe "Measure Memory" do
let
(
:config
)
do
let
(
:config
)
do
{
{
:shared_memory_size
=>
"2m"
,
:shared_memory_size
=>
"2m"
,
:shared_memory_cleanup_objects_ttl
=>
"60m"
,
:message_ttl
=>
"60m"
,
:message_ttl
=>
"60m"
,
:max_messages_stored_per_channel
=>
nil
,
:max_messages_stored_per_channel
=>
nil
,
:keepalive
=>
"on"
,
:keepalive
=>
"on"
,
...
...
misc/spec/mix/send_signals_spec.rb
View file @
63dcebcc
...
@@ -19,7 +19,6 @@ describe "Send Signals" do
...
@@ -19,7 +19,6 @@ describe "Send Signals" do
:master_process
=>
'on'
,
:master_process
=>
'on'
,
:daemon
=>
'on'
,
:daemon
=>
'on'
,
:header_template
=>
'HEADER'
,
:header_template
=>
'HEADER'
,
:shared_memory_cleanup_objects_ttl
=>
'40s'
,
:message_ttl
=>
'60s'
,
:message_ttl
=>
'60s'
,
:subscriber_connection_ttl
=>
'65s'
:subscriber_connection_ttl
=>
'65s'
}
}
...
...
misc/spec/nginx_configuration.rb
View file @
63dcebcc
...
@@ -30,7 +30,7 @@ module NginxConfiguration
...
@@ -30,7 +30,7 @@ module NginxConfiguration
:broadcast_channel_max_qtd
=>
3
,
:broadcast_channel_max_qtd
=>
3
,
:broadcast_channel_prefix
=>
'broad_'
,
:broadcast_channel_prefix
=>
'broad_'
,
:shared_memory_cleanup_objects_ttl
=>
'5m'
,
:shared_memory_cleanup_objects_ttl
=>
nil
,
:subscriber_mode
=>
nil
,
:subscriber_mode
=>
nil
,
:publisher_mode
=>
nil
,
:publisher_mode
=>
nil
,
...
...
misc/spec/publisher/properties_spec.rb
View file @
63dcebcc
...
@@ -765,7 +765,6 @@ describe "Publisher Properties" do
...
@@ -765,7 +765,6 @@ describe "Publisher Properties" do
:header_template
=>
nil
,
:header_template
=>
nil
,
:footer_template
=>
"FOOTER"
,
:footer_template
=>
"FOOTER"
,
:ping_message_interval
=>
nil
,
:ping_message_interval
=>
nil
,
:shared_memory_cleanup_objects_ttl
=>
nil
,
:message_template
=>
'{\"id\":\"~id~\", \"channel\":\"~channel~\", \"text\":\"~text~\"}'
:message_template
=>
'{\"id\":\"~id~\", \"channel\":\"~channel~\", \"text\":\"~text~\"}'
})
})
...
...
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