Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check for last_fullsync_completed in stats. #708

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions tests/replication_stats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,44 @@ fullsync_enabled_and_started() ->
{FullTime, _} = timer:tc(repl_util,
start_and_wait_until_fullsync_complete,
[LeaderA, undefined, Me]),
lager:info("Fullsync completed in ~p", [FullTime])
lager:info("Fullsync completed in ~p", [FullTime]),
Me ! fullsync_completed
end),

Result = receive
StartedResult = receive
fullsync_started ->
lager:info("Fullsync started!"),

case rpc:call(LeaderA, riak_repl_console, fs_remotes_status,
[]) of
{badrpc, _} ->
fail;
badrpc;
Stats ->
?assertEqual(Stats,
[{fullsync_enabled, "B"},
{fullsync_running, "B"}]),
pass
end
after 60000 ->
fail
timeout
end,

?assertEqual(pass, StartedResult),

_ = receive
fullsync_completed -> ok
after 60000 ->
?assert(timeout)
end,

FullStats = rpc:call(AFirst, riak_repl_console, status, [quiet]),
CoordinatorStats = proplists:get_value(fullsync_coordinator, FullStats, []),
BStats = proplists:get_value("B", CoordinatorStats, []),
LastFullsyncValue = proplists:get_value(last_fullsync_completed, BStats, no_exists),

?assertMatch({{_Year, _Month, _Day}, {_Hour, _Minute, _Second}}, LastFullsyncValue),

rt:clean_cluster(ANodes),
rt:clean_cluster(BNodes),

Result.
StartedResult.