Open honglei opened 4 years ago
./02-subscribe-qos1.py c/02-subscribe-qos1-async2.test
fails on my Ubuntu 18.04 machine in a similar way (but async1.test
runs fine):
sigmund@ubuntu1:~/mosquitto/test/lib$ ./02-subscribe-qos1.py ./c/02-subscribe-qos1-async1.test && echo $?
0
sigmund@ubuntu1:~/mosquitto/test/lib$ ./02-subscribe-qos1.py ./c/02-subscribe-qos1-async2.test && echo $?
connect_async failed: Connection refused
Traceback (most recent call last):
File "./02-subscribe-qos1.py", line 47, in <module>
(conn, address) = sock.accept()
File "/usr/lib/python3.6/socket.py", line 205, in accept
fd, addr = self._accept()
socket.timeout: timed out
If I make this change in test/lib/02-subscribe-qos1.py
:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
->
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
then both tests pass:
sigmund@ubuntu1:~/mosquitto/test/lib$ ./02-subscribe-qos1.py ./c/02-subscribe-qos1-async1.test && echo $?
0
sigmund@ubuntu1:~/mosquitto/test/lib$ ./02-subscribe-qos1.py ./c/02-subscribe-qos1-async2.test && echo $?
0
I have not not yet figured out the reason for this, but it might be useful information. (The broker listens on the same port using both AF_INET
and AF_INET6
sockets, so one fix would be to make the tests do the same. But if would of course be good to understand why that would be required...)
I'm seeing the same problem using Fedora 33 and https://github.com/eclipse/mosquitto/commit/5c45bc4e8407d94d29b39152b580d2b4cc8082e9.
make test
output:So, I add user
mosquitto
, and rerun it: