Fixed last_cmsg_id in session takeover and improve test stability for persistence plugin tests

Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
This commit is contained in:
Norbert Heusser
2024-01-23 09:10:29 +00:00
committed by Roger Light
parent d14d6bdfc8
commit 55a402aadf
6 changed files with 13 additions and 0 deletions

View File

@@ -153,6 +153,7 @@ int connect__on_authorised(struct mosquitto *context, void *auth_data_out, uint1
memcpy(&context->msgs_in, &found_context->msgs_in, sizeof(struct mosquitto_msg_data));
memcpy(&context->msgs_out, &found_context->msgs_out, sizeof(struct mosquitto_msg_data));
context->last_cmsg_id = found_context->last_cmsg_id;
memset(&found_context->msgs_in, 0, sizeof(struct mosquitto_msg_data));
memset(&found_context->msgs_out, 0, sizeof(struct mosquitto_msg_data));

View File

@@ -78,6 +78,9 @@ try:
helper.send(pubrec2_packet)
mosq_test.do_receive_send(helper, pubrel2_packet, pubcomp2_packet, "pubcomp2 receive")
# Send ping and wait for the PINGRESP to make sure the broker has processed all sent puback
mosq_test.do_ping(helper)
# Kill broker
(broker_terminate_rc, stde) = mosq_test.terminate_broker(broker)
broker = None

View File

@@ -77,6 +77,9 @@ try:
helper.send(pubrec2_packet)
mosq_test.do_receive_send(helper, pubrel2_packet, pubcomp2_packet, "pubcomp2 receive")
# Send ping and wait for the PINGRESP to make sure the broker has processed all sent puback
mosq_test.do_ping(helper)
# Kill broker
(broker_terminate_rc, stde) = mosq_test.terminate_broker(broker)
broker = None

View File

@@ -81,6 +81,8 @@ try:
mosq_test.do_receive_send(sock, publish_packet1, puback_packet, "publish 1")
mosq_test.do_receive_send(sock, publish_packet2, pubrec_packet, "publish 2")
mosq_test.do_receive_send(sock, pubrel_packet, pubcomp_packet, "pubrel 2")
# Send ping and wait for the PINGRESP to make sure the broker has processed all sent pubcomp
mosq_test.do_ping(sock)
sock.close()
# Connect client again, it should have a session

View File

@@ -78,6 +78,8 @@ try:
mosq_test.do_receive_send(sock, publish_packet1, puback_packet, "publish 1")
mosq_test.do_receive_send(sock, publish_packet2, pubrec_packet, "publish 2")
mosq_test.do_receive_send(sock, pubrel_packet, pubcomp_packet, "pubrel 2")
# Send ping and wait for the PINGRESP to make sure the broker has processed all sent pubcomp
mosq_test.do_ping(sock)
sock.close()
# Connect client again, it should have a session

View File

@@ -84,6 +84,8 @@ try:
mosq_test.do_receive_send(sock, publish_packet1, puback_packet, "publish 1")
mosq_test.do_receive_send(sock, publish_packet2, pubrec_packet, "publish 2")
mosq_test.do_receive_send(sock, pubrel_packet, pubcomp_packet, "pubrel 2")
# Send ping and wait for the PINGRESP to make sure the broker has processed all sent pubcomp
mosq_test.do_ping(sock)
sock.close()
# Connect client again, it should have a session