Repository navigation
Closed
Description
test_service_browser_expire_callbacks test fails on openSUSE Tubmleweed aarch64 and ppc64le with version 0.38.6.
Log:
[ 130s] =================================== FAILURES ===================================
[ 130s] ____________________ test_service_browser_expire_callbacks _____________________
[ 130s]
[ 130s] @patch.object(_handlers, '_DNS_PTR_MIN_TTL', 1)
[ 130s] @patch.object(_core, "_CACHE_CLEANUP_INTERVAL", 10)
[ 130s] def test_service_browser_expire_callbacks():
[ 130s] """Test that the ServiceBrowser matching does not match partial names."""
[ 130s] # instantiate a zeroconf instance
[ 130s] zc = Zeroconf(interfaces=['127.0.0.1'])
[ 130s] # start a browser
[ 130s] type_ = "_old._tcp.local."
[ 130s] registration_name = "uniquezip323.%s" % type_
[ 130s] callbacks = []
[ 130s]
[ 130s] class MyServiceListener(r.ServiceListener):
[ 130s] def add_service(self, zc, type_, name) -> None:
[ 130s] nonlocal callbacks
[ 130s] if name == registration_name:
[ 130s] callbacks.append(("add", type_, name))
[ 130s]
[ 130s] def remove_service(self, zc, type_, name) -> None:
[ 130s] nonlocal callbacks
[ 130s] if name == registration_name:
[ 130s] callbacks.append(("remove", type_, name))
[ 130s]
[ 130s] def update_service(self, zc, type_, name) -> None:
[ 130s] nonlocal callbacks
[ 130s] if name == registration_name:
[ 130s] callbacks.append(("update", type_, name))
[ 130s]
[ 130s] listener = MyServiceListener()
[ 130s]
[ 130s] browser = r.ServiceBrowser(zc, type_, None, listener)
[ 130s]
[ 130s] desc = {'path': '/~paul2/'}
[ 130s] address_parsed = "10.0.1.3"
[ 130s] address = socket.inet_aton(address_parsed)
[ 130s] info = ServiceInfo(
[ 130s] type_,
[ 130s] registration_name,
[ 130s] 80,
[ 130s] 0,
[ 130s] 0,
[ 130s] desc,
[ 130s] "newname-2.local.",
[ 130s] host_ttl=1,
[ 130s] other_ttl=1,
[ 130s] addresses=[address],
[ 130s] )
[ 130s]
[ 130s] def mock_incoming_msg(records) -> r.DNSIncoming:
[ 130s] generated = r.DNSOutgoing(const._FLAGS_QR_RESPONSE)
[ 130s] for record in records:
[ 130s] generated.add_answer_at_time(record, 0)
[ 130s] return r.DNSIncoming(generated.packets()[0])
[ 130s]
[ 130s] _inject_response(
[ 130s] zc,
[ 130s] mock_incoming_msg([info.dns_pointer(), info.dns_service(), info.dns_text(), *info.dns_addresses()]),
[ 130s] )
[ 130s] time.sleep(0.3)
[ 130s] info.port = 400
[ 130s] _inject_response(
[ 130s] zc,
[ 130s] mock_incoming_msg([info.dns_service()]),
[ 130s] )
[ 130s]
[ 130s] > assert callbacks == [
[ 130s] ('add', type_, registration_name),
[ 130s] ('update', type_, registration_name),
[ 130s] ]
[ 130s] E AssertionError: assert [('add', '_ol..._tcp.local.')] == [('add', '_ol..._tcp.local.')]
[ 130s] E Right contains one more item: ('update', '_old._tcp.local.', 'uniquezip323._old._tcp.local.')
[ 130s] E Full diff:
[ 130s] E [
[ 130s] E ('add',
[ 130s] E '_old._tcp.local.',
[ 130s] E 'uniquezip323._old._tcp.local.'),
[ 130s] E - ('update',...
[ 130s] E
[ 130s] E ...Full output truncated (4 lines hidden), use '-vv' to show
[ 130s]
[ 130s] tests/services/test_browser.py:1168: AssertionError
x86_64 and ppc64 are fine.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Update python-zeroconf to version 0.38.7 / rev 32 via SR 985062
bdraco commentedon Oct 19, 2022
Is this still failing for you on the latest sha?
ggardet commentedon Oct 24, 2022
It does not fail anymore with version 0.39.1
bdraco commentedon Oct 24, 2022
Thanks for confirming