pytest: test threaded resolver

Add `resolv-threaded` to curlinfo to detect use of the threaded resolver
correctly even with c-ares linked to https-rr.

Run test_21_05 exactly when threaded resolver is built.

Closes #21287
This commit is contained in:
Stefan Eissing 2026-04-10 11:43:28 +02:00 committed by Daniel Stenberg
parent 879209fc88
commit a483128b01
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 14 additions and 2 deletions

View file

@ -109,7 +109,7 @@ class TestResolve:
assert os.path.exists(dfiles[1])
# use .invalid host name, parallel, single resolve thread
@pytest.mark.skipif(condition=Env.curl_uses_lib('c-ares'), reason="c-ares resolver skipped")
@pytest.mark.skipif(condition=not Env.curl_resolv_threaded(), reason="no threaded resolver")
def test_21_05_resolv_single_thread(self, env: Env, httpd, nghttpx):
count = 10
delay_ms = 50

View file

@ -165,6 +165,7 @@ class EnvConfig:
self.curl_is_verbose = 'verbose-strings: ON' in p.stdout
self.curl_can_cert_status = 'cert-status: ON' in p.stdout
self.curl_override_dns = 'override-dns: ON' in p.stdout
self.curl_resolv_threaded = 'resolv-threaded: ON' in p.stdout
self.ports = {}
@ -515,6 +516,10 @@ class Env:
def curl_override_dns() -> bool:
return Env.CONFIG.curl_override_dns
@staticmethod
def curl_resolv_threaded() -> bool:
return Env.CONFIG.curl_resolv_threaded
@staticmethod
def curl_can_early_data() -> bool:
if Env.curl_uses_lib('gnutls'):