eclipse / paho.mqtt.testing

An Eclipse Paho project - a Python broker for testing
https://eclipse.org/paho
Other
108 stars 73 forks source link

client_test5.py test_flow_control2 possibly incorrect behaviour #77

Open mochi-co opened 1 year ago

mochi-co commented 1 year ago

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):

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 commented 1 year ago

Duplicate/Related of #68