INNER CODE UNIT · Python

test_sync_profiles

openHiTLS/openHiTLS · testcode/benchmark/async_perf/test_async_perf.py:36

    def test_sync_profiles(self):
        for mode in ("inline", "worker"):
            with self.subTest(mode=mode):
                proc, rows, _ = self.run_benchmark(
                    "-a", "hs-sync-*", "--repeat", "2", "-c", "4",
                    "--device-mode", mode, "-w", "4",
                )
                self.assertEqual(proc.returncode, 0, proc.stdout)
                self.assertEqual(len(rows), 10)
                for row in rows:
                    self.assertEqual(row["status"], "OK", row)
                    self.assertEqual(row["handshakes"], "4", row)
                    self.assertEqual(row["pauses"], "0", row)
                    self.assertEqual(row["failures"], "0", row)
                    self.assertGreater(int(row["batch_ns"]), 0)

    def test_async_profiles(self):
        supported = os.environ.get("ASYNC_PERF_EXPECT_ASYNC", "1") == "1"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…