mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-06 02:52:07 +08:00
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:
committed by
Roger Light
parent
d14d6bdfc8
commit
55a402aadf
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user