From 5530a18892cdfdd0e054d65a4789efe6460f85d6 Mon Sep 17 00:00:00 2001 From: David Ansari Date: Wed, 23 Oct 2024 17:36:58 +0000 Subject: [PATCH] Attempt to eliminate test flake This commit attempts to eliminate the test flake described in https://github.com/rabbitmq/rabbitmq-server/issues/12413#issuecomment-2385449940 ``` 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 17df1b9343d5e92b4178c3027f6bdafd38a0eb26) --- deps/rabbitmq_mqtt/test/shared_SUITE.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/rabbitmq_mqtt/test/shared_SUITE.erl b/deps/rabbitmq_mqtt/test/shared_SUITE.erl index e265243d9c99..62f94c1164a5 100644 --- a/deps/rabbitmq_mqtt/test/shared_SUITE.erl +++ b/deps/rabbitmq_mqtt/test/shared_SUITE.erl @@ -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.