Skip to content

flakey test https://github.com/python-zeroconf/python-zeroconf/actions/runs/25982493999/job/76373619315 #1696

@bdraco

Description

@bdraco

flakey test https://github.com/python-zeroconf/python-zeroconf/actions/runs/25982493999/job/76373619315

C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs\zeroconf-8qF2J-3a-py3.11\Lib\site-packages\coverage\inorout.py:537: CoverageWarning: Module zeroconf was previously imported, but not measured (module-not-measured)
  self.warn(msg, slug="module-not-measured")
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\ast.py:50: ResourceWarning: unclosed <socket.socket fd=2728, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
  return compile(source, filename, mode, flags,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\proactor_events.py:116: ResourceWarning: unclosed transport <_ProactorDatagramTransport closing fd=-1 write=<_OverlappedFuture finished result=378>>
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
tests/utils/test_net.py::test_create_sockets_interfaces_all PASSED       [100%]

================================== FAILURES ===================================
________ TestServiceInfo.test_get_info_suppressed_by_question_history _________

self = <tests.services.test_info.TestServiceInfo testMethod=test_get_info_suppressed_by_question_history>

    @unittest.skipIf(not has_working_ipv6(), "Requires IPv6")
    @unittest.skipIf(os.environ.get("SKIP_IPV6"), "IPv6 tests disabled")
    def test_get_info_suppressed_by_question_history(self):
        zc = r.Zeroconf(interfaces=["127.0.0.1"])
    
        service_name = "name._type._tcp.local."
        service_type = "_type._tcp.local."
    
        service_info = None
        send_event = Event()
        service_info_event = Event()
    
        last_sent: r.DNSOutgoing | None = None
    
        def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
            """Sends an outgoing packet."""
            nonlocal last_sent
    
            last_sent = out
            send_event.set()
    
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_cache.py::test_async_get_unique_returns_newest_record
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\proactor_events.py:116: ResourceWarning: unclosed transport <_ProactorDatagramTransport closing fd=1604 write=<_OverlappedFuture finished result=138>>
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_core.py::test_shutdown_while_register_in_process
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\events.py:107: ResourceWarning: unclosed <socket.socket fd=2232, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
    def __init__(self, when, callback, args, loop, context=None):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_core.py::test_shutdown_while_register_in_process
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\events.py:107: ResourceWarning: unclosed <socket.socket fd=2168, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
    def __init__(self, when, callback, args, loop, context=None):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_core.py::test_shutdown_while_register_in_process
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\events.py:107: ResourceWarning: unclosed <socket.socket fd=2236, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
    def __init__(self, when, callback, args, loop, context=None):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_core.py::test_shutdown_while_register_in_process
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\events.py:107: ResourceWarning: unclosed <socket.socket fd=2172, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
    def __init__(self, when, callback, args, loop, context=None):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_dns.py::test_dns_record_hashablity_does_not_consider_unique
  C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs\zeroconf-8qF2J-3a-py3.11\Lib\site-packages\_pytest\nodes.py:355: ResourceWarning: unclosed <socket.socket fd=2116, family=2, type=2, proto=0, laddr=('0.0.0.0', 5353)>
    for mark in node.own_markers:
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_dns.py::test_dns_record_hashablity_does_not_consider_unique
  C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs\zeroconf-8qF2J-3a-py3.11\Lib\site-packages\_pytest\nodes.py:355: ResourceWarning: unclosed <socket.socket fd=2136, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
    for mark in node.own_markers:
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_qu_response
  <frozen os>:679: ResourceWarning: unclosed <socket.socket fd=2660, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_qu_response
  <frozen os>:679: ResourceWarning: unclosed <socket.socket fd=2428, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_questions_query_handler_does_not_put_qu_questions_in_history
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\proactor_events.py:116: ResourceWarning: unclosed transport <_ProactorDatagramTransport closing fd=2720 write=<_OverlappedFuture finished result=145>>
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_questions_query_handler_does_not_put_qu_questions_in_history
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\base_events.py:1954: ResourceWarning: unclosed <socket.socket fd=2728, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
    def get_debug(self):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_questions_query_handler_does_not_put_qu_questions_in_history
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\proactor_events.py:116: ResourceWarning: unclosed transport <_ProactorDatagramTransport closing fd=-1 write=<_OverlappedFuture finished result=130>>
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_response_aggregation_timings
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\proactor_events.py:116: ResourceWarning: unclosed transport <_ProactorDatagramTransport fd=1384 read=<_OverlappedFuture cancelled>>
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_response_aggregation_timings
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\proactor_events.py:116: ResourceWarning: unclosed transport <_ProactorDatagramTransport fd=1568 read=<_OverlappedFuture cancelled>>
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_response_aggregation_timings
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\unittest\mock.py:2178: ResourceWarning: unclosed <socket.socket fd=2736, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
    def __init__(self, name, parent):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_response_aggregation_timings
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\proactor_events.py:116: ResourceWarning: unclosed transport <_ProactorDatagramTransport closing fd=-1 write=<_OverlappedFuture finished result=127>>
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_response_aggregation_random_delay
  D:\a\python-zeroconf\python-zeroconf\src\zeroconf\_dns.py:74: ResourceWarning: unclosed <socket.socket fd=2748, family=2, type=2, proto=0, laddr=('0.0.0.0', 5353)>
    def _fast_init_entry(self, name: str, type_: _int, class_: _int) -> None:
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_handlers.py::test_response_aggregation_random_delay
  D:\a\python-zeroconf\python-zeroconf\src\zeroconf\_dns.py:74: ResourceWarning: unclosed <socket.socket fd=2764, family=2, type=2, proto=0, laddr=('127.0.0.1', 5353)>
    def _fast_init_entry(self, name: str, type_: _int, class_: _int) -> None:
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/utils/test_name.py::test_possible_types
  C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\asyncio\base_events.py:693: ResourceWarning: unclosed event loop <ProactorEventLoop running=False closed=False debug=False>
    _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================== tests coverage ================================
_______________ coverage: platform win32, python 3.11.9-final-0 _______________

Name                                                 Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------------------------------
src\zeroconf\__init__.py                                23      0      0      0   100%
src\zeroconf\_cache.py                                 141      0     64      0   100%
src\zeroconf\_core.py                                  286      2     78      1    99%   140-141
src\zeroconf\_dns.py                                   270      1     16      0    99%   622
src\zeroconf\_engine.py                                 86      0     20      0   100%
src\zeroconf\_exceptions.py                             10      0      0      0   100%
src\zeroconf\_handlers\__init__.py                       1      0      0      0   100%
src\zeroconf\_handlers\answers.py                       46      0     10      0   100%
src\zeroconf\_handlers\multicast_outgoing_queue.py      50      0     16      0   100%
src\zeroconf\_handlers\query_handler.py                216      0    106      0   100%
src\zeroconf\_handlers\record_manager.py                90      1     34      0    99%   221
src\zeroconf\_history.py                                27      0     10      0   100%
src\zeroconf\_listener.py                              103      5     30      1    95%   141-145
src\zeroconf\_logger.py                                 48      0     10      0   100%
src\zeroconf\_protocol\__init__.py                       1      0      0      0   100%
src\zeroconf\_protocol\incoming.py                     245      2     56      0    99%   199-200
src\zeroconf\_protocol\outgoing.py                     245      0     60      0   100%
src\zeroconf\_record_update.py                          16      0      4      0   100%
src\zeroconf\_services\__init__.py                      36      0      2      0   100%
src\zeroconf\_services\browser.py                      335      1     94      3    99%   309, 410->exit, 544->exit
src\zeroconf\_services\info.py                         448      0    146      0   100%
src\zeroconf\_services\registry.py                      52      0      8      0   100%
src\zeroconf\_services\types.py                         24      0      2      0   100%
src\zeroconf\_transport.py                              14      0      0      0   100%
src\zeroconf\_updates.py                                12      0      2      0   100%
src\zeroconf\_utils\__init__.py                          1      0      0      0   100%
src\zeroconf\_utils\asyncio.py                          61      0      8      0   100%
src\zeroconf\_utils\ipaddress.py                        77      0      6      0   100%
src\zeroconf\_utils\name.py                             64      0     42      1    99%   171->176
src\zeroconf\_utils\net.py                             227      6     98      3    97%   225-229, 286, 473->466
src\zeroconf\_utils\time.py                              7      0      0      0   100%
src\zeroconf\asyncio.py                                 72      0      6      0   100%
src\zeroconf\const.py                                   76      0      0      0   100%
------------------------------------------------------------------------------------------------
TOTAL                                                 3410     18    928      9    99%
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml
============================ slowest 20 durations =============================
9.83s call     tests/test_asyncio.py::test_service_info_async_request
6.83s call     tests/test_services.py::ListenerTest::test_integration_with_listener_class
4.49s call     tests/test_asyncio.py::test_async_zeroconf_service_types
4.28s call     tests/services/test_types.py::test_integration_with_listener
4.28s call     tests/services/test_types.py::test_integration_with_listener_v6_records
4.27s call     tests/services/test_types.py::test_integration_with_subtype_and_listener
3.31s call     tests/test_core.py::Framework::test_async_updates_from_response
3.22s call     tests/services/test_browser.py::TestServiceBrowser::test_update_record
3.01s call     tests/services/test_info.py::TestServiceInfo::test_get_info_suppressed_by_question_history
3.00s call     tests/services/test_info.py::test_we_try_four_times_with_random_delay
2.97s call     tests/test_handlers.py::test_response_aggregation_timings
2.88s call     tests/test_handlers.py::TestRegistrar::test_register_and_lookup_type_by_uppercase_name
2.87s call     tests/test_asyncio.py::test_async_service_registration
2.78s call     tests/test_handlers.py::test_response_aggregation_timings_multiple
2.71s call     tests/test_init.py::Names::test_verify_name_change_with_lots_of_names
2.40s call     tests/test_asyncio.py::test_async_service_browser
2.39s call     tests/test_asyncio.py::test_async_tasks
2.37s call     tests/test_asyncio.py::test_async_service_registration_with_server_missing
2.34s call     tests/test_asyncio.py::test_async_service_registration_name_conflict
2.20s call     tests/test_handlers.py::TestRegistrar::test_name_conflicts
=========================== short test summary info ===========================
FAILED tests/services/test_info.py::TestServiceInfo::test_get_info_suppressed_by_question_history - assert None is not None
====== 1 failed, 333 passed, 4 skipped, 49 warnings in 125.41s (0:02:05) ======

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions