Skip to content

Commit 64b4d3e

Browse files
committed
test: make test_qu_response deterministic by injecting the announcement
1 parent 6b2a9f6 commit 64b4d3e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎tests/test_handlers.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,10 @@ def test_qu_response(quick_timing: None) -> None:
636636
"ash-other.local.",
637637
addresses=[socket.inet_aton("10.0.4.2")],
638638
)
639-
# register
640-
zc.register_service(info)
639+
# Register and inject the announcement directly so the cache state is
640+
# deterministic; announcing on loopback would race the phases below.
641+
zc.registry.async_add(info)
642+
_inject_response(zc, r.DNSIncoming(zc.generate_service_broadcast(info, None).packets()[0]))
641643

642644
def _validate_complete_response(answers):
643645
has_srv = has_txt = has_a = has_aaaa = has_nsec = False

0 commit comments

Comments
 (0)