mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Set jmx port to -1 to force failure of startup in JMX app.
- even if run as root or port is already in use (as JMX failure in that case will allow the Java app to continue to run).
This commit is contained in:
parent
5c321fbf12
commit
19c44d982c
@ -118,7 +118,10 @@ confirm() ->
|
||||
pass.
|
||||
|
||||
test_supervision() ->
|
||||
JMXPort = 22,
|
||||
%% Specifically invalid port number to make JMX startup fail.
|
||||
%% NOTE: using a priveleged port doesn't work in some test environments
|
||||
%% as tests/riak are running as root. For this test, -1 is fine.
|
||||
JMXPort = -1,
|
||||
Config = [{riak_jmx, [{enabled, true}, {port, JMXPort}]}],
|
||||
[Node|[]] = rt:deploy_nodes(1, Config),
|
||||
timer:sleep(20000),
|
||||
@ -148,11 +151,11 @@ test_supervision() ->
|
||||
%% Error logging is 0-based, so look for Retry #9
|
||||
{Delay, _Retry} = rt:get_retry_settings(),
|
||||
TwoMinutes = 2*60*1000,
|
||||
TwoMinutsOfRetry = TwoMinutes div Delay,
|
||||
Retries = TwoMinutes div Delay,
|
||||
?assertEqual(true, rt:expect_in_log(Node, "JMX server monitor .* exited with code .*\. Retry #9",
|
||||
TwoMinutsOfRetry, Delay)),
|
||||
Retries, Delay)),
|
||||
?assertEqual(true, rt:expect_in_log(Node, "JMX server monitor .* exited with code .*\. Reached maximum retries of 10",
|
||||
TwoMinutsOfRetry, Delay)),
|
||||
Retries, Delay)),
|
||||
rt:stop(Node),
|
||||
ok_ok.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user