INNER CODE UNIT · Python
test_json_thresholds
openHiTLS/openHiTLS · testcode/benchmark/async_perf/test_async_perf.py:207
def test_json_thresholds(self):
thresholds = self.root / "thresholds.json"
thresholds.write_text(json.dumps({"q1_sync_cross_build": 1.3, "noise_inline": 0.01}))
proc = self.compare(self.dataset("base", [100] * 5), self.dataset("cand", [120] * 5),
"--thresholds", thresholds)
self.assertEqual(proc.returncode, 0, proc.stdout)
self.assertIn("PASS", proc.stdout)
def test_cross_form(self):
base = self.dataset("base", [100] * 5, mode="worker")
for form in ("on-fd", "on-cb"):
with self.subTest(form=form):
proc = self.compare(base, self.dataset("cand", [40] * 5, form=form, mode="worker"),
"--pair", f"{form}:sync")
self.assertEqual(proc.returncode, 0, proc.stdout)
self.assertIn("Q3", proc.stdout)
self.assertIn("PASS", proc.stdout)