Skip to content

Commit 32b81aa

Browse files
committed
🔧 doq adguard unreachable in CI
1 parent b241199 commit 32b81aa

File tree

2 files changed

+85
-32
lines changed

2 files changed

+85
-32
lines changed

test/contrib/asynchronous/test_resolver.py

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import asyncio
4+
import os
45
import socket
56
from test import requires_network
67

@@ -131,8 +132,11 @@ async def test_url_resolver(
131132
)
132133
@pytest.mark.asyncio
133134
async def test_1_1_1_1_ipv4_resolution_across_protocols(dns_url: str) -> None:
134-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
135-
pytest.skip("Test requires qh3 installed")
135+
if dns_url.startswith("doq"):
136+
if QUICResolver is _MISSING_QUIC_SENTINEL:
137+
pytest.skip("Test requires qh3 installed")
138+
if os.environ.get("CI"):
139+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
136140

137141
resolver = AsyncResolverDescription.from_url(dns_url).new()
138142

@@ -174,8 +178,11 @@ async def test_1_1_1_1_ipv4_resolution_across_protocols(dns_url: str) -> None:
174178
async def test_dnssec_exception(
175179
dns_url: str, hostname: str, expected_failure: bool
176180
) -> None:
177-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
178-
pytest.skip("Test requires qh3 installed")
181+
if dns_url.startswith("doq"):
182+
if QUICResolver is _MISSING_QUIC_SENTINEL:
183+
pytest.skip("Test requires qh3 installed")
184+
if os.environ.get("CI"):
185+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
179186

180187
resolver = AsyncResolverDescription.from_url(dns_url).new()
181188

@@ -301,8 +308,11 @@ async def test_many_resolver_host_constraint_distribution() -> None:
301308
)
302309
@pytest.mark.asyncio
303310
async def test_short_endurance_sprint(dns_url: str) -> None:
304-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
305-
pytest.skip("Test requires qh3 installed")
311+
if dns_url.startswith("doq"):
312+
if QUICResolver is _MISSING_QUIC_SENTINEL:
313+
pytest.skip("Test requires qh3 installed")
314+
if os.environ.get("CI"):
315+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
306316

307317
resolver = AsyncResolverDescription.from_url(dns_url).new()
308318

@@ -387,8 +397,11 @@ async def test_doh_rfc8484(dns_url: str) -> None:
387397
)
388398
@pytest.mark.asyncio
389399
async def test_task_safe_resolver(dns_url: str) -> None:
390-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
391-
pytest.skip("Test requires qh3 installed")
400+
if dns_url.startswith("doq"):
401+
if QUICResolver is _MISSING_QUIC_SENTINEL:
402+
pytest.skip("Test requires qh3 installed")
403+
if os.environ.get("CI"):
404+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
392405

393406
resolver = AsyncResolverDescription.from_url(dns_url).new()
394407

@@ -471,8 +484,11 @@ async def test_many_resolver_task_safe() -> None:
471484
)
472485
@pytest.mark.asyncio
473486
async def test_resolver_recycle(dns_url: str) -> None:
474-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
475-
pytest.skip("Test requires qh3 installed")
487+
if dns_url.startswith("doq"):
488+
if QUICResolver is _MISSING_QUIC_SENTINEL:
489+
pytest.skip("Test requires qh3 installed")
490+
if os.environ.get("CI"):
491+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
476492

477493
resolver = AsyncResolverDescription.from_url(dns_url).new()
478494

@@ -507,8 +523,11 @@ async def test_resolver_recycle(dns_url: str) -> None:
507523
)
508524
@pytest.mark.asyncio
509525
async def test_resolve_cannot_recycle_when_available(dns_url: str) -> None:
510-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
511-
pytest.skip("Test requires qh3 installed")
526+
if dns_url.startswith("doq"):
527+
if QUICResolver is _MISSING_QUIC_SENTINEL:
528+
pytest.skip("Test requires qh3 installed")
529+
if os.environ.get("CI"):
530+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
512531

513532
resolver = AsyncResolverDescription.from_url(dns_url).new()
514533

@@ -532,8 +551,11 @@ async def test_resolve_cannot_recycle_when_available(dns_url: str) -> None:
532551
@pytest.mark.asyncio
533552
async def test_ipv6_always_preferred(dns_url: str) -> None:
534553
"""Our resolvers must place IPV6 address in the beginning of returned list."""
535-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
536-
pytest.skip("Test requires qh3 installed")
554+
if dns_url.startswith("doq"):
555+
if QUICResolver is _MISSING_QUIC_SENTINEL:
556+
pytest.skip("Test requires qh3 installed")
557+
if os.environ.get("CI"):
558+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
537559

538560
resolver = AsyncResolverDescription.from_url(dns_url).new()
539561

@@ -570,8 +592,11 @@ async def test_ipv6_always_preferred(dns_url: str) -> None:
570592
@pytest.mark.asyncio
571593
async def test_dgram_upgrade(dns_url: str) -> None:
572594
"""www.cloudflare.com records HTTPS exist, we know it. This verify that we are able to propose a DGRAM upgrade."""
573-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
574-
pytest.skip("Test requires qh3 installed")
595+
if dns_url.startswith("doq"):
596+
if QUICResolver is _MISSING_QUIC_SENTINEL:
597+
pytest.skip("Test requires qh3 installed")
598+
if os.environ.get("CI"):
599+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
575600

576601
resolver = AsyncResolverDescription.from_url(dns_url).new()
577602

test/contrib/test_resolver.py

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import os
34
import socket
45
from concurrent.futures import ThreadPoolExecutor
56
from socket import AddressFamily, SocketKind
@@ -94,6 +95,9 @@ def test_url_resolver(
9495
if expected_resolver_class is _MISSING_QUIC_SENTINEL:
9596
pytest.skip("Test requires qh3 installed")
9697

98+
if url.startswith("doq://") and os.environ.get("CI", None) is not None:
99+
pytest.skip("Adguard unreachable in CI")
100+
97101
if expected_resolver_class is None:
98102
with pytest.raises(
99103
(
@@ -129,8 +133,11 @@ def test_url_resolver(
129133
],
130134
)
131135
def test_1_1_1_1_ipv4_resolution_across_protocols(dns_url: str) -> None:
132-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
133-
pytest.skip("Test requires qh3 installed")
136+
if dns_url.startswith("doq"):
137+
if QUICResolver is _MISSING_QUIC_SENTINEL:
138+
pytest.skip("Test requires qh3 installed")
139+
if os.environ.get("CI"):
140+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
134141

135142
resolver = ResolverDescription.from_url(dns_url).new()
136143

@@ -168,8 +175,11 @@ def test_1_1_1_1_ipv4_resolution_across_protocols(dns_url: str) -> None:
168175
],
169176
)
170177
def test_dnssec_exception(dns_url: str, hostname: str, expected_failure: bool) -> None:
171-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
172-
pytest.skip("Test requires qh3 installed")
178+
if dns_url.startswith("doq"):
179+
if QUICResolver is _MISSING_QUIC_SENTINEL:
180+
pytest.skip("Test requires qh3 installed")
181+
if os.environ.get("CI"):
182+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
173183

174184
resolver = ResolverDescription.from_url(dns_url).new()
175185

@@ -292,8 +302,11 @@ def test_many_resolver_host_constraint_distribution() -> None:
292302
],
293303
)
294304
def test_short_endurance_sprint(dns_url: str) -> None:
295-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
296-
pytest.skip("Test requires qh3 installed")
305+
if dns_url.startswith("doq"):
306+
if QUICResolver is _MISSING_QUIC_SENTINEL:
307+
pytest.skip("Test requires qh3 installed")
308+
if os.environ.get("CI"):
309+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
297310

298311
resolver = ResolverDescription.from_url(dns_url).new()
299312

@@ -376,8 +389,11 @@ def test_doh_rfc8484(dns_url: str) -> None:
376389
],
377390
)
378391
def test_thread_safe_resolver(dns_url: str) -> None:
379-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
380-
pytest.skip("Test requires qh3 installed")
392+
if dns_url.startswith("doq"):
393+
if QUICResolver is _MISSING_QUIC_SENTINEL:
394+
pytest.skip("Test requires qh3 installed")
395+
if os.environ.get("CI"):
396+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
381397

382398
resolver = ResolverDescription.from_url(dns_url).new()
383399

@@ -478,8 +494,11 @@ def _run(
478494
],
479495
)
480496
def test_resolver_recycle(dns_url: str) -> None:
481-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
482-
pytest.skip("Test requires qh3 installed")
497+
if dns_url.startswith("doq"):
498+
if QUICResolver is _MISSING_QUIC_SENTINEL:
499+
pytest.skip("Test requires qh3 installed")
500+
if os.environ.get("CI"):
501+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
483502

484503
resolver = ResolverDescription.from_url(dns_url).new()
485504

@@ -513,8 +532,11 @@ def test_resolver_recycle(dns_url: str) -> None:
513532
],
514533
)
515534
def test_resolve_cannot_recycle_when_available(dns_url: str) -> None:
516-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
517-
pytest.skip("Test requires qh3 installed")
535+
if dns_url.startswith("doq"):
536+
if QUICResolver is _MISSING_QUIC_SENTINEL:
537+
pytest.skip("Test requires qh3 installed")
538+
if os.environ.get("CI"):
539+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
518540

519541
resolver = ResolverDescription.from_url(dns_url).new()
520542

@@ -537,8 +559,11 @@ def test_resolve_cannot_recycle_when_available(dns_url: str) -> None:
537559
)
538560
def test_ipv6_always_preferred(dns_url: str) -> None:
539561
"""Our resolvers must place IPV6 address in the beginning of returned list."""
540-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
541-
pytest.skip("Test requires qh3 installed")
562+
if dns_url.startswith("doq"):
563+
if QUICResolver is _MISSING_QUIC_SENTINEL:
564+
pytest.skip("Test requires qh3 installed")
565+
if os.environ.get("CI"):
566+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
542567

543568
resolver = ResolverDescription.from_url(dns_url).new()
544569

@@ -574,8 +599,11 @@ def test_ipv6_always_preferred(dns_url: str) -> None:
574599
)
575600
def test_dgram_upgrade(dns_url: str) -> None:
576601
"""www.cloudflare.com records HTTPS exist, we know it. This verify that we are able to propose a DGRAM upgrade."""
577-
if QUICResolver is _MISSING_QUIC_SENTINEL and dns_url.startswith("doq"):
578-
pytest.skip("Test requires qh3 installed")
602+
if dns_url.startswith("doq"):
603+
if QUICResolver is _MISSING_QUIC_SENTINEL:
604+
pytest.skip("Test requires qh3 installed")
605+
if os.environ.get("CI"):
606+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
579607

580608
resolver = ResolverDescription.from_url(dns_url).new()
581609

0 commit comments

Comments
 (0)