Skip to content

Commit

Permalink
Attempt to eliminate test flake
Browse files Browse the repository at this point in the history
This commit attempts to eliminate the test flake described in
#12413 (comment)

```
rabbitmq_mqtt > parallel-ct-set-1 > mqtt_shared_SUITE > cluster_size_3 > v4 rabbit_mqtt_qos0_queue_kill_node

=== Ended at 2024-10-01 09:59:52
=== Location: [{mqtt_shared_SUITE,rabbit_mqtt_qos0_queue_kill_node,[1165](https://github.com/rabbitmq/rabbitmq-server/issues/mqtt_shared_suite.src.html#1165)},
              {test_server,ts_tc,1793},
              {test_server,run_test_case_eval1,1302},
              {test_server,run_test_case_eval,1234}]
=== === Reason: no match of right hand side value {publish_not_received,
                                                    <<"m1">>}
  in function  mqtt_shared_SUITE:rabbit_mqtt_qos0_queue_kill_node/1 (mqtt_shared_SUITE.erl, line 1165)
  in call from test_server:ts_tc/3 (test_server.erl, line 1793)
  in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1302)
  in call from test_server:run_test_case_eval/9 (test_server.erl, line 1234)
```

This flake could not be reproduced locally.
This commit also assumes that this flake occurred under Khepri but not
under Mnesia.

The hypothesis is the following:
* Node 0 is down
* MQTT client creates binding on node 1
* Khepri commits since the binding is replicated and persisted on node 1
  and node 2. However the binding isn't reflected yet in node 2's
  routing projecting table.
* Publishing a message to node 2 routes to nowhere.

(cherry picked from commit 17df1b9)
  • Loading branch information
ansd committed Oct 23, 2024
1 parent 1e76a74 commit 5530a18
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions deps/rabbitmq_mqtt/test/shared_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,7 @@ rabbit_mqtt_qos0_queue_kill_node(Config) ->
%% Re-connect to a live node with same MQTT client ID.
Sub1 = connect(SubscriberId, Config, 1, []),
{ok, _, [0]} = emqtt:subscribe(Sub1, Topic2, qos0),
ok = await_metadata_store_consistent(Config, 2),
ok = emqtt:publish(Pub, Topic2, <<"m1">>, qos0),
ok = expect_publishes(Sub1, Topic2, [<<"m1">>]),
%% Since we started a new clean session, previous subscription should have been deleted.
Expand Down

0 comments on commit 5530a18

Please sign in to comment.