Skip to content

Commit 91aa21d

Browse files
authored
test: fix race in test_register_and_lookup_type_by_uppercase_name (#1712)
1 parent 4bae30a commit 91aa21d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_handlers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ def test_register_and_lookup_type_by_uppercase_name(self):
219219
for _ in range(50):
220220
time.sleep(0.02)
221221
info.load_from_cache(zc)
222-
if info.addresses:
222+
# Wait for both A and TXT records — they arrive as separate
223+
# cache updates and the listener may schedule the assertions
224+
# between the two. Breaking on just `info.addresses` makes
225+
# the test flaky under PyPy / skip_cython.
226+
if info.addresses and info.properties:
223227
break
224228
assert info.addresses == [socket.inet_pton(socket.AF_INET, "1.2.3.4")]
225229
assert info.properties == {b"version": b"1.0"}

0 commit comments

Comments
 (0)