Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client_test5.py test_flow_control2 possibly incorrect behaviour #77

Open
mochi-co opened this issue Nov 28, 2022 · 1 comment
Open

client_test5.py test_flow_control2 possibly incorrect behaviour #77

mochi-co opened this issue Nov 28, 2022 · 1 comment

Comments

@mochi-co
Copy link

Hi @icraggs - firstly, thank you so much for all the work you have put into this test suite. It's an incredible tool for ensuring compliance.

I have a question regarding the behaviour of client_test5.py test_flow_control2.

In the MQTTv5 Specification (my emphasis):

  • "The Client MUST NOT send more than Receive Maximum QoS 1 and QoS 2 PUBLISH packets for which it has not received PUBACK, PUBCOMP, or PUBREC with a Reason Code of 128 or greater from the Server [MQTT-3.3.4-7]. If it receives more than Receive Maximum QoS 1 and QoS 2 PUBLISH packets where it has not sent a PUBACK or PUBCOMP in response, the Server uses a DISCONNECT packet with Reason Code 0x93 (Receive Maximum exceeded) as described in [section 4.13]", and,
  • "3.14.4 DISCONNECT Actions
    After sending a DISCONNECT packet the sender:
    MUST NOT send any more MQTT Control Packets on that Network Connection [MQTT-3.14.4-1].
    MUST close the Network Connection [MQTT-3.14.4-2]."

However, test_flow_control2 relies on the completion of the qos 2 flow in order to be successful prior to disconnect, and will fail with the following error if the server adheres to the above, ceasing to send any more packets immediately following the issuance of a disconnect:

E/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/unittest/case.py:621: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 55249)>
  outcome.errors.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback

======================================================================
ERROR: test_flow_control2 (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mochi/Projects/Development/mochi-co/paho.mqtt.testing-master/interoperability/client_test5.py", line 1020, in test_flow_control2
    receiver.receive(testcallback)
  File "/Users/mochi/Projects/Development/mochi-co/paho.mqtt.testing-master/interoperability/mqtt/clients/V5/internal.py", line 86, in receive
    self.socket.send(self.pubrel.pack())
BrokenPipeError: [Errno 32] Broken pipe

In my understanding, the test should pass if the server ceases reading packets and immediately closes the connection once the disconnect has been successfully sent.

I look forward to your thoughts and any clarifications you might have.
Thanks again

@mochi-co
Copy link
Author

mochi-co commented Dec 1, 2022

Duplicate/Related of #68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant