Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mtproto_proxy
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
mtproto_proxy
Commits
07d397ce
Unverified
Commit
07d397ce
authored
May 10, 2019
by
Сергей Прохоров
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: fix bug in common test reset code
parent
977109d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
single_dc_SUITE.erl
test/single_dc_SUITE.erl
+11
-6
No files found.
test/single_dc_SUITE.erl
View file @
07d397ce
...
@@ -151,8 +151,8 @@ downstream_size_backpressure_case({pre, Cfg}) ->
...
@@ -151,8 +151,8 @@ downstream_size_backpressure_case({pre, Cfg}) ->
%% Disable upstream healthchecks
%% Disable upstream healthchecks
set_env
([{
upstream_healthchecks
,
[]}],
Cfg1
);
set_env
([{
upstream_healthchecks
,
[]}],
Cfg1
);
downstream_size_backpressure_case
({
post
,
Cfg
})
->
downstream_size_backpressure_case
({
post
,
Cfg
})
->
reset_env
(
Cfg
),
stop_single
(
Cfg
),
stop_single
(
Cfg
);
reset_env
(
Cfg
);
downstream_size_backpressure_case
(
Cfg
)
when
is_list
(
Cfg
)
->
downstream_size_backpressure_case
(
Cfg
)
when
is_list
(
Cfg
)
->
DcId
=
?
config
(
dc_id
,
Cfg
),
DcId
=
?
config
(
dc_id
,
Cfg
),
Host
=
?
config
(
mtp_host
,
Cfg
),
Host
=
?
config
(
mtp_host
,
Cfg
),
...
@@ -213,8 +213,8 @@ downstream_qlen_backpressure_case({pre, Cfg}) ->
...
@@ -213,8 +213,8 @@ downstream_qlen_backpressure_case({pre, Cfg}) ->
{
upstream_healthchecks
,
[]}],
Cfg
),
{
upstream_healthchecks
,
[]}],
Cfg
),
setup_single
(
?
FUNCTION_NAME
,
10000
+
?
LINE
,
#
{
rpc_handler
=>
mtp_test_cmd_rpc
},
Cfg1
);
setup_single
(
?
FUNCTION_NAME
,
10000
+
?
LINE
,
#
{
rpc_handler
=>
mtp_test_cmd_rpc
},
Cfg1
);
downstream_qlen_backpressure_case
({
post
,
Cfg
})
->
downstream_qlen_backpressure_case
({
post
,
Cfg
})
->
reset_env
(
Cfg
),
stop_single
(
Cfg
),
stop_single
(
Cfg
);
reset_env
(
Cfg
);
downstream_qlen_backpressure_case
(
Cfg
)
when
is_list
(
Cfg
)
->
downstream_qlen_backpressure_case
(
Cfg
)
when
is_list
(
Cfg
)
->
DcId
=
?
config
(
dc_id
,
Cfg
),
DcId
=
?
config
(
dc_id
,
Cfg
),
Host
=
?
config
(
mtp_host
,
Cfg
),
Host
=
?
config
(
mtp_host
,
Cfg
),
...
@@ -327,7 +327,6 @@ setup_single(Name, MtpPort, DcCfg0, Cfg) ->
...
@@ -327,7 +327,6 @@ setup_single(Name, MtpPort, DcCfg0, Cfg) ->
application
:
load
(
mtproto_proxy
),
application
:
load
(
mtproto_proxy
),
Cfg1
=
set_env
([{
ports
,
Listeners
}],
Cfg
),
Cfg1
=
set_env
([{
ports
,
Listeners
}],
Cfg
),
{
ok
,
DcCfg
}
=
mtp_test_datacenter
:
start_dc
(
PubKey
,
DcConf
,
DcCfg0
),
{
ok
,
DcCfg
}
=
mtp_test_datacenter
:
start_dc
(
PubKey
,
DcConf
,
DcCfg0
),
application
:
load
(
mtproto_proxy
),
{
ok
,
_}
=
application
:
ensure_all_started
(
mtproto_proxy
),
{
ok
,
_}
=
application
:
ensure_all_started
(
mtproto_proxy
),
[{
dc_id
,
DcId
},
[{
dc_id
,
DcId
},
{
mtp_host
,
Ip
},
{
mtp_host
,
Ip
},
...
@@ -340,6 +339,7 @@ stop_single(Cfg) ->
...
@@ -340,6 +339,7 @@ stop_single(Cfg) ->
DcCfg
=
?
config
(
dc_conf
,
Cfg
),
DcCfg
=
?
config
(
dc_conf
,
Cfg
),
MetricPid
=
?
config
(
metric
,
Cfg
),
MetricPid
=
?
config
(
metric
,
Cfg
),
ok
=
application
:
stop
(
mtproto_proxy
),
ok
=
application
:
stop
(
mtproto_proxy
),
ok
=
application
:
unload
(
mtproto_proxy
),
{
ok
,
_}
=
mtp_test_datacenter
:
stop_dc
(
DcCfg
),
{
ok
,
_}
=
mtp_test_datacenter
:
stop_dc
(
DcCfg
),
gen_server
:
stop
(
MetricPid
),
gen_server
:
stop
(
MetricPid
),
Cfg
.
Cfg
.
...
@@ -357,7 +357,12 @@ set_env(Env, Cfg) ->
...
@@ -357,7 +357,12 @@ set_env(Env, Cfg) ->
end
,
end
,
{
K
,
OldV
}
{
K
,
OldV
}
end
||
{
K
,
V
}
<-
Env
],
end
||
{
K
,
V
}
<-
Env
],
[{
mtp_env
,
OldEnv
}
|
Cfg
].
case
proplists
:
get_value
(
mtp_env
,
Cfg
)
of
undefined
->
[{
mtp_env
,
OldEnv
}
|
Cfg
];
L
->
[{
mtp_env
,
OldEnv
++
L
}
|
Cfg
]
end
.
reset_env
(
Cfg
)
->
reset_env
(
Cfg
)
->
OldEnv
=
?
config
(
mtp_env
,
Cfg
),
OldEnv
=
?
config
(
mtp_env
,
Cfg
),
...
...
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