Skip to content

Commit 4654466

Browse files
committed
Fix test for brokers who publish on $SYS
Fix test for brokers who publish data occasionally to $SYS, such as EMQ X and then causes false negative results. Fixes setting the port when testing with non-default port.
1 parent 4a683e2 commit 4654466

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

interoperability/client_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def connectionLost(self, cause):
3535
logging.info("connectionLost %s", str(cause))
3636

3737
def publishArrived(self, topicName, payload, qos, retained, msgid):
38+
if topicName.startswith("$SYS/"):
39+
return True
3840
logging.info("publishArrived %s %s %d %d %d", topicName, payload, qos, retained, msgid)
3941
self.messages.append((topicName, payload, qos, retained, msgid))
4042
return True
@@ -163,7 +165,7 @@ def test_retained_messages(self):
163165
time.sleep(1)
164166
aclient.disconnect()
165167

166-
assert len(callback.messages) == 3
168+
self.assertEqual(len(callback.messages), 3)
167169

168170
# clear retained messages
169171
callback.clear()
@@ -448,6 +450,8 @@ def test_unsubscribe(self):
448450
host = a
449451
elif o in ("-p", "--port"):
450452
port = int(a)
453+
sys.argv.remove("-p") if "-p" in sys.argv else sys.argv.remove("--port")
454+
sys.argv.remove(a)
451455
elif o in ("--iterations"):
452456
iterations = int(a)
453457
else:

0 commit comments

Comments
 (0)