diff --git a/tests/test_bench_translate.py b/tests/test_bench_translate.py index 4a94c8d6bf..aead9008bf 100644 --- a/tests/test_bench_translate.py +++ b/tests/test_bench_translate.py @@ -102,12 +102,18 @@ def test_a_local_baseline_replaces_the_committed_one(self): written = run("--runs", "1", "--size", "20", "--write-baseline", path) self.assertEqual(written.returncode, 0, written.stderr) self.assertTrue(os.path.isfile(path)) - result = run("--runs", "1", "--size", "20", "--baseline", path, "--max-slowdown", "5", "--json") + # What this case is about is that a local baseline replaces the committed one, and the way to say that without + # measuring CPU contention is to compare the numbers back against the file that was just written. The limit + # behaviour has its own deterministic test (--max-slowdown 0.01 must report one). + with open(path, encoding="utf-8") as handle: + written = json.load(handle)["measured"] + result = run("--runs", "1", "--size", "20", "--baseline", path, "--json") self.assertEqual(result.returncode, 0, result.stderr) report = json.loads(result.stdout) self.assertEqual(report["baseline_source"], os.path.abspath(path)) self.assertEqual(sorted(report["baseline"]), sorted(report["measured"])) - self.assertEqual(report["over_limit"], []) + # The baseline is that file's own numbers, not the committed ones: substituting the latter fails here. + self.assertEqual(report["baseline"], written) def test_compare_runs_two_trees_and_prints_a_ratio(self): tools = os.path.join(ROOT, "tools")