Merge pull request #8795 from thalesmg/flaky-shared-sub-test

test: attempt to fix flaky shared sub test
This commit is contained in:
Thales Macedo Garitezi 2022-08-24 10:34:53 -03:00 committed by GitHub
commit 268eb59dab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -353,7 +353,7 @@ t_local(_) ->
ok = ensure_group_config(Node, GroupConfig), ok = ensure_group_config(Node, GroupConfig),
ok = ensure_group_config(GroupConfig), ok = ensure_group_config(GroupConfig),
Topic = <<"local_foo/bar">>, Topic = <<"local_foo1/bar">>,
ClientId1 = <<"ClientId1">>, ClientId1 = <<"ClientId1">>,
ClientId2 = <<"ClientId2">>, ClientId2 = <<"ClientId2">>,
@ -363,8 +363,8 @@ t_local(_) ->
{ok, _} = emqtt:connect(ConnPid1), {ok, _} = emqtt:connect(ConnPid1),
{ok, _} = emqtt:connect(ConnPid2), {ok, _} = emqtt:connect(ConnPid2),
emqtt:subscribe(ConnPid1, {<<"$share/local_group/local_foo/bar">>, 0}), emqtt:subscribe(ConnPid1, {<<"$share/local_group/", Topic/binary>>, 0}),
emqtt:subscribe(ConnPid2, {<<"$share/local_group/local_foo/bar">>, 0}), emqtt:subscribe(ConnPid2, {<<"$share/local_group/", Topic/binary>>, 0}),
ct:sleep(100), ct:sleep(100),
@ -396,7 +396,7 @@ t_local_fallback(_) ->
<<"sticky_group">> => sticky <<"sticky_group">> => sticky
}), }),
Topic = <<"local_foo/bar">>, Topic = <<"local_foo2/bar">>,
ClientId1 = <<"ClientId1">>, ClientId1 = <<"ClientId1">>,
ClientId2 = <<"ClientId2">>, ClientId2 = <<"ClientId2">>,
Node = start_slave('local_fallback_shared_sub_test19', 11885), Node = start_slave('local_fallback_shared_sub_test19', 11885),
@ -406,12 +406,12 @@ t_local_fallback(_) ->
Message1 = emqx_message:make(ClientId1, 0, Topic, <<"hello1">>), Message1 = emqx_message:make(ClientId1, 0, Topic, <<"hello1">>),
Message2 = emqx_message:make(ClientId2, 0, Topic, <<"hello2">>), Message2 = emqx_message:make(ClientId2, 0, Topic, <<"hello2">>),
emqtt:subscribe(ConnPid1, {<<"$share/local_group_fallback/local_foo/bar">>, 0}), emqtt:subscribe(ConnPid1, {<<"$share/local_group_fallback/", Topic/binary>>, 0}),
[{share, <<"local_foo/bar">>, {ok, 1}}] = emqx:publish(Message1), [{share, Topic, {ok, 1}}] = emqx:publish(Message1),
{true, UsedSubPid1} = last_message(<<"hello1">>, [ConnPid1]), {true, UsedSubPid1} = last_message(<<"hello1">>, [ConnPid1]),
[{share, <<"local_foo/bar">>, {ok, 1}}] = rpc:call(Node, emqx, publish, [Message2]), [{share, Topic, {ok, 1}}] = rpc:call(Node, emqx, publish, [Message2]),
{true, UsedSubPid2} = last_message(<<"hello2">>, [ConnPid1]), {true, UsedSubPid2} = last_message(<<"hello2">>, [ConnPid1]),
emqtt:stop(ConnPid1), emqtt:stop(ConnPid1),