Skip to content

Commit

Permalink
Test updated
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonUnge committed Jun 14, 2023
1 parent 0ca18b9 commit 00c3fb7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions deps/rabbit/src/rabbit_queue_member_eval.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
-record(state, {timer_ref :: reference() | undefined,
default_interval :: non_neg_integer(),
short_interval :: non_neg_integer(),
target_group_size :: non_neg_integer() | undefined}).
target_group_size :: non_neg_integer() | undefined,
enabled :: boolean()}).

%%----------------------------------------------------------------------------
%% Start
Expand Down Expand Up @@ -63,7 +64,8 @@ init([]) ->
false),
State = #state{default_interval = DefaultInterval,
short_interval = ShortInterval,
target_group_size = TargetGroupSize},
target_group_size = TargetGroupSize,
enabled = Enabled},
case Enabled of
true ->
Ref = erlang:send_after(DefaultInterval, self(), ?EVAL_MSG),
Expand All @@ -75,7 +77,7 @@ init([]) ->
handle_call(_Request, _From, State) ->
{reply, ok, State}.

handle_cast(nodechange, #state{timer_ref = undefined} = State) ->
handle_cast(nodechange, #state{enabled = false} = State) ->
{noreply, State, hibernate};
handle_cast(nodechange, #state{timer_ref = OldRef,
short_interval = Time} = State) ->
Expand All @@ -97,6 +99,8 @@ handle_info(?EVAL_MSG, #state{default_interval = DefaultInterval,
end,
Ref = erlang:send_after(NewTimeout, self(), ?EVAL_MSG),
{noreply, State#state{timer_ref = Ref}};
handle_info(_Info, #state{enabled = false} = State) ->
{noreply, State, hibernate};
handle_info(_Info, State) ->
{noreply, State}.

Expand Down
1 change: 1 addition & 0 deletions deps/rabbit/test/member_evaluation_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ init_per_suite(Config0) ->
rabbit_ct_helpers:log_environment(),
Config1 = rabbit_ct_helpers:merge_app_env(
Config0, {rabbit, [{quorum_tick_interval, 1000},
{member_eval_enabled, true},
{member_eval_default_timeout, 5000},
{member_eval_short_timeout, 2000},
{member_eval_target_group_size, 3}]}),
Expand Down

0 comments on commit 00c3fb7

Please sign in to comment.