Skip to content

Commit 9455a7b

Browse files
committed
🔧 doq adguard unreachable in CI
1 parent b241199 commit 9455a7b

File tree

2 files changed

+82
-32
lines changed

2 files changed

+82
-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: 41 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
@@ -129,8 +130,11 @@ def test_url_resolver(
129130
],
130131
)
131132
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")
133+
if dns_url.startswith("doq"):
134+
if QUICResolver is _MISSING_QUIC_SENTINEL:
135+
pytest.skip("Test requires qh3 installed")
136+
if os.environ.get("CI"):
137+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
134138

135139
resolver = ResolverDescription.from_url(dns_url).new()
136140

@@ -168,8 +172,11 @@ def test_1_1_1_1_ipv4_resolution_across_protocols(dns_url: str) -> None:
168172
],
169173
)
170174
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")
175+
if dns_url.startswith("doq"):
176+
if QUICResolver is _MISSING_QUIC_SENTINEL:
177+
pytest.skip("Test requires qh3 installed")
178+
if os.environ.get("CI"):
179+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
173180

174181
resolver = ResolverDescription.from_url(dns_url).new()
175182

@@ -292,8 +299,11 @@ def test_many_resolver_host_constraint_distribution() -> None:
292299
],
293300
)
294301
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")
302+
if dns_url.startswith("doq"):
303+
if QUICResolver is _MISSING_QUIC_SENTINEL:
304+
pytest.skip("Test requires qh3 installed")
305+
if os.environ.get("CI"):
306+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
297307

298308
resolver = ResolverDescription.from_url(dns_url).new()
299309

@@ -376,8 +386,11 @@ def test_doh_rfc8484(dns_url: str) -> None:
376386
],
377387
)
378388
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")
389+
if dns_url.startswith("doq"):
390+
if QUICResolver is _MISSING_QUIC_SENTINEL:
391+
pytest.skip("Test requires qh3 installed")
392+
if os.environ.get("CI"):
393+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
381394

382395
resolver = ResolverDescription.from_url(dns_url).new()
383396

@@ -478,8 +491,11 @@ def _run(
478491
],
479492
)
480493
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")
494+
if dns_url.startswith("doq"):
495+
if QUICResolver is _MISSING_QUIC_SENTINEL:
496+
pytest.skip("Test requires qh3 installed")
497+
if os.environ.get("CI"):
498+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
483499

484500
resolver = ResolverDescription.from_url(dns_url).new()
485501

@@ -513,8 +529,11 @@ def test_resolver_recycle(dns_url: str) -> None:
513529
],
514530
)
515531
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")
532+
if dns_url.startswith("doq"):
533+
if QUICResolver is _MISSING_QUIC_SENTINEL:
534+
pytest.skip("Test requires qh3 installed")
535+
if os.environ.get("CI"):
536+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
518537

519538
resolver = ResolverDescription.from_url(dns_url).new()
520539

@@ -537,8 +556,11 @@ def test_resolve_cannot_recycle_when_available(dns_url: str) -> None:
537556
)
538557
def test_ipv6_always_preferred(dns_url: str) -> None:
539558
"""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")
559+
if dns_url.startswith("doq"):
560+
if QUICResolver is _MISSING_QUIC_SENTINEL:
561+
pytest.skip("Test requires qh3 installed")
562+
if os.environ.get("CI"):
563+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
542564

543565
resolver = ResolverDescription.from_url(dns_url).new()
544566

@@ -574,8 +596,11 @@ def test_ipv6_always_preferred(dns_url: str) -> None:
574596
)
575597
def test_dgram_upgrade(dns_url: str) -> None:
576598
"""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")
599+
if dns_url.startswith("doq"):
600+
if QUICResolver is _MISSING_QUIC_SENTINEL:
601+
pytest.skip("Test requires qh3 installed")
602+
if os.environ.get("CI"):
603+
pytest.skip("DoQ unreliable in CI (adguard unreachable)")
579604

580605
resolver = ResolverDescription.from_url(dns_url).new()
581606

0 commit comments

Comments
 (0)