http3/ngtcp2: shorten handshake, trace cleanup

- shorten handshake timing by delayed x509 store load (OpenSSL)
  as we do for HTTP/2
- cleanup of trace output, align with HTTP/2 output

Closes #11609
This commit is contained in:
Stefan Eissing 2023-08-07 11:42:23 +02:00 committed by Daniel Stenberg
parent 95ca3c53d3
commit 199fb4b94a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 79 additions and 92 deletions

View file

@ -33,7 +33,7 @@ import sys
from statistics import mean
from typing import Dict, Any, Optional, List
from testenv import Env, Httpd, Nghttpx, CurlClient, Caddy, ExecResult
from testenv import Env, Httpd, Nghttpx, CurlClient, Caddy, ExecResult, NghttpxFwd
log = logging.getLogger(__name__)
@ -67,33 +67,7 @@ class ScoreCard:
sample_size = 5
self.info(f'TLS Handshake\n')
for authority in [
f'{self.env.authority_for(self.env.domain1, proto)}'
]:
self.info(' localhost...')
c_samples = []
hs_samples = []
errors = []
for i in range(sample_size):
curl = CurlClient(env=self.env, silent=self._silent_curl)
url = f'https://{authority}/'
r = curl.http_download(urls=[url], alpn_proto=proto,
no_save=True)
if r.exit_code == 0 and len(r.stats) == 1:
c_samples.append(r.stats[0]['time_connect'])
hs_samples.append(r.stats[0]['time_appconnect'])
else:
errors.append(f'exit={r.exit_code}')
props['localhost'] = {
'ipv4-connect': mean(c_samples),
'ipv4-handshake': mean(hs_samples),
'ipv4-errors': errors,
'ipv6-connect': 0,
'ipv6-handshake': 0,
'ipv6-errors': [],
}
self.info('ok.\n')
for authority in [
'curl.se', 'nghttp2.org',
'curl.se', 'google.com', 'cloudflare.com', 'nghttp2.org'
]:
self.info(f' {authority}...')
props[authority] = {}
@ -556,7 +530,7 @@ def main():
httpd.clear_logs()
assert httpd.start()
if 'h3' == protocol:
nghttpx = Nghttpx(env=env)
nghttpx = NghttpxFwd(env=env)
nghttpx.clear_logs()
assert nghttpx.start()
if test_caddy and env.caddy:

View file

@ -65,7 +65,7 @@ class TestErrors:
r.check_exit_code(False)
invalid_stats = []
for idx, s in enumerate(r.stats):
if 'exitcode' not in s or s['exitcode'] not in [18, 56, 92]:
if 'exitcode' not in s or s['exitcode'] not in [18, 56, 92, 95]:
invalid_stats.append(f'request {idx} exit with {s["exitcode"]}')
assert len(invalid_stats) == 0, f'failed: {invalid_stats}'