INNER CODE UNIT · Python
test_async_profiles
openHiTLS/openHiTLS · testcode/benchmark/async_perf/test_async_perf.py:52
def test_async_profiles(self):
supported = os.environ.get("ASYNC_PERF_EXPECT_ASYNC", "1") == "1"
for mode in ("inline", "worker"):
with self.subTest(mode=mode):
proc, rows, _ = self.run_benchmark(
"-a", "hs-on-*", "--repeat", "2", "-c", "10",
"--device-mode", mode, "-w", "4",
)
self.assertEqual(proc.returncode, 0, proc.stdout)
self.assertEqual(len(rows), 20)
for row in rows:
self.assertEqual(row["status"], "OK" if supported else "UNSUPPORTED", row)
if not supported:
continue
self.assertEqual(row["handshakes"], "10", row)
self.assertEqual(row["failures"], "0", row)
self.assertGreater(int(row["batch_ns"]), 0)
if row["scenario"].endswith("tls13-psk"):