mirror of
https://github.com/curl/curl.git
synced 2025-02-23 15:10:03 +08:00
pytest: use lower count in repeat tests
- lower large iteration counts in some tests somewhat for the same coverage with less duration Closes #12248
This commit is contained in:
parent
30e04beafe
commit
7e1c0851bf
@ -108,16 +108,17 @@ class TestDownload:
|
||||
|
||||
# download 500 files sequential
|
||||
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
|
||||
def test_02_05_download_500_sequential(self, env: Env,
|
||||
httpd, nghttpx, repeat, proto):
|
||||
def test_02_05_download_many_sequential(self, env: Env,
|
||||
httpd, nghttpx, repeat, proto):
|
||||
if proto == 'h3' and not env.have_h3():
|
||||
pytest.skip("h3 not supported")
|
||||
if proto == 'h3' and env.curl_uses_lib('msh3'):
|
||||
pytest.skip("msh3 shaky here")
|
||||
count = 200
|
||||
curl = CurlClient(env=env)
|
||||
urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-499]'
|
||||
urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-{count-1}]'
|
||||
r = curl.http_download(urls=[urln], alpn_proto=proto)
|
||||
r.check_response(http_status=200, count=500)
|
||||
r.check_response(http_status=200, count=count)
|
||||
if proto == 'http/1.1':
|
||||
# http/1.1 parallel transfers will open multiple connections
|
||||
assert r.total_connects > 1, r.dump_logs()
|
||||
@ -127,11 +128,11 @@ class TestDownload:
|
||||
|
||||
# download 500 files parallel
|
||||
@pytest.mark.parametrize("proto", ['h2', 'h3'])
|
||||
def test_02_06_download_500_parallel(self, env: Env,
|
||||
httpd, nghttpx, repeat, proto):
|
||||
def test_02_06_download_many_parallel(self, env: Env,
|
||||
httpd, nghttpx, repeat, proto):
|
||||
if proto == 'h3' and not env.have_h3():
|
||||
pytest.skip("h3 not supported")
|
||||
count = 500
|
||||
count = 200
|
||||
max_parallel = 50
|
||||
curl = CurlClient(env=env)
|
||||
urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[000-{count-1}]'
|
||||
@ -207,7 +208,7 @@ class TestDownload:
|
||||
httpd, nghttpx, repeat, proto):
|
||||
if proto == 'h3' and not env.have_h3():
|
||||
pytest.skip("h3 not supported")
|
||||
count = 20
|
||||
count = 10
|
||||
urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]'
|
||||
curl = CurlClient(env=env)
|
||||
r = curl.http_download(urls=[urln], alpn_proto=proto)
|
||||
@ -222,7 +223,7 @@ class TestDownload:
|
||||
pytest.skip("h3 not supported")
|
||||
if proto == 'h3' and env.curl_uses_lib('msh3'):
|
||||
pytest.skip("msh3 stalls here")
|
||||
count = 20
|
||||
count = 10
|
||||
urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]'
|
||||
curl = CurlClient(env=env)
|
||||
r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[
|
||||
@ -235,7 +236,7 @@ class TestDownload:
|
||||
httpd, nghttpx, repeat, proto):
|
||||
if proto == 'h3' and not env.have_h3():
|
||||
pytest.skip("h3 not supported")
|
||||
count = 100
|
||||
count = 50
|
||||
urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]'
|
||||
curl = CurlClient(env=env)
|
||||
r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[
|
||||
@ -248,7 +249,7 @@ class TestDownload:
|
||||
httpd, nghttpx, repeat, proto):
|
||||
if proto == 'h3' and not env.have_h3():
|
||||
pytest.skip("h3 not supported")
|
||||
count = 100
|
||||
count = 50
|
||||
urln = f'http://{env.domain1}:{env.http_port}/data-10m?[0-{count-1}]'
|
||||
curl = CurlClient(env=env)
|
||||
r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[
|
||||
|
@ -124,7 +124,7 @@ class TestUpload:
|
||||
if proto == 'h3' and env.curl_uses_lib('msh3'):
|
||||
pytest.skip("msh3 stalls here")
|
||||
fdata = os.path.join(env.gen_dir, 'data-100k')
|
||||
count = 50
|
||||
count = 20
|
||||
curl = CurlClient(env=env)
|
||||
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]'
|
||||
r = curl.http_upload(urls=[url], data=f'@{fdata}', alpn_proto=proto)
|
||||
@ -161,7 +161,7 @@ class TestUpload:
|
||||
if proto == 'h3' and env.curl_uses_lib('msh3'):
|
||||
pytest.skip("msh3 stalls here")
|
||||
# limit since we use a separate connection in h1
|
||||
count = 50
|
||||
count = 20
|
||||
data = '0123456789'
|
||||
curl = CurlClient(env=env)
|
||||
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]'
|
||||
@ -181,7 +181,7 @@ class TestUpload:
|
||||
pytest.skip("msh3 stalls here")
|
||||
fdata = os.path.join(env.gen_dir, 'data-100k')
|
||||
# limit since we use a separate connection in h1
|
||||
count = 50
|
||||
count = 20
|
||||
curl = CurlClient(env=env)
|
||||
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]'
|
||||
r = curl.http_upload(urls=[url], data=f'@{fdata}', alpn_proto=proto,
|
||||
@ -219,7 +219,7 @@ class TestUpload:
|
||||
fdata = os.path.join(env.gen_dir, 'data-10m')
|
||||
count = 1
|
||||
curl = CurlClient(env=env)
|
||||
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?id=[0-{count-1}]&chunk_delay=10ms'
|
||||
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?id=[0-{count-1}]&chunk_delay=2ms'
|
||||
r = curl.http_put(urls=[url], fdata=fdata, alpn_proto=proto,
|
||||
extra_args=['--parallel'])
|
||||
r.check_stats(count=count, http_status=200, exitcode=0)
|
||||
|
Loading…
Reference in New Issue
Block a user