Skip to content

Commit 7d33119

Browse files
committed
amqp10_inter_cluster_SUITE: Use per-test shovel names
[Why] I believe that the fact the same names were used for all four test cases caused a race condition: I think it was possible that a test case ended up seeing the resources of the previous test case because of the asynchronous nature of some operations.
1 parent d0875c9 commit 7d33119

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

deps/rabbitmq_shovel/test/amqp10_inter_cluster_SUITE.erl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,23 @@ end_per_testcase(Testcase, Config) ->
7575
rabbit_ct_helpers:testcase_finished(Config, Testcase).
7676

7777
old_to_new_on_old(Config) ->
78-
ok = shovel(?OLD, ?NEW, ?OLD, Config).
78+
ok = shovel(?FUNCTION_NAME, ?OLD, ?NEW, ?OLD, Config).
7979

8080
old_to_new_on_new(Config) ->
81-
ok = shovel(?OLD, ?NEW, ?NEW, Config).
81+
ok = shovel(?FUNCTION_NAME, ?OLD, ?NEW, ?NEW, Config).
8282

8383
new_to_old_on_old(Config) ->
84-
ok = shovel(?NEW, ?OLD, ?OLD, Config).
84+
ok = shovel(?FUNCTION_NAME, ?NEW, ?OLD, ?OLD, Config).
8585

8686
new_to_old_on_new(Config) ->
87-
ok = shovel(?NEW, ?OLD, ?NEW, Config).
87+
ok = shovel(?FUNCTION_NAME, ?NEW, ?OLD, ?NEW, Config).
8888

89-
shovel(SrcNode, DestNode, ShovelNode, Config) ->
89+
shovel(Caller, SrcNode, DestNode, ShovelNode, Config) ->
9090
SrcUri = shovel_test_utils:make_uri(Config, SrcNode),
9191
DestUri = shovel_test_utils:make_uri(Config, DestNode),
92-
SrcQ = <<"my source queue">>,
93-
DestQ = <<"my destination queue">>,
92+
ShovelName = atom_to_binary(Caller),
93+
SrcQ = <<ShovelName/binary, " source">>,
94+
DestQ = <<ShovelName/binary, " destination">>,
9495
Definition = [
9596
{<<"src-uri">>, SrcUri},
9697
{<<"src-protocol">>, <<"amqp10">>},
@@ -99,7 +100,6 @@ shovel(SrcNode, DestNode, ShovelNode, Config) ->
99100
{<<"dest-protocol">>, <<"amqp10">>},
100101
{<<"dest-address">>, DestQ}
101102
],
102-
ShovelName = <<"my shovel">>,
103103
ok = rpc(Config, ShovelNode, rabbit_runtime_parameters, set,
104104
[<<"/">>, <<"shovel">>, ShovelName, Definition, none]),
105105
ok = shovel_test_utils:await_shovel(Config, ShovelNode, ShovelName),

0 commit comments

Comments
 (0)