Skip to content

Commit 6e875b2

Browse files
committed
test: make the release-performance self-comparison E2E independent of runner noise
The E2E compares one build with itself using a single run, so asserting a passed verdict depended on wall-time noise (a 1.31x wall ratio at 0.99x CPU failed CI). It now asserts the report structure, every command row, the per-side generator markers and the recorded evidence, and accepts either verdict as long as the exit code matches it. The production 1.25x limits are unchanged; the verdict unit tests gain fixed-timing cases for a wall-only regression at CPU parity and a wall-only slowdown just under the limit. Fixes CHI-481
1 parent 8d2e4cb commit 6e875b2

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

‎tests/e2e/scripts/release_performance/_test_types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class ReleasePerformanceTestCase:
1010
description: str
1111
inspection_models: int
1212
build_models: int
13-
expected_return_code: int
13+
expected_outcomes: tuple[tuple[int, bool], ...]
1414
expected_fragments: tuple[str, ...]
1515
expected_marked_projects: tuple[str, ...]

‎tests/e2e/scripts/release_performance/test_compare_release_performance.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
"test_case",
2525
(
2626
ReleasePerformanceTestCase(
27-
description="the same build as candidate and baseline passes every command",
27+
description="the same build as candidate and baseline reports every command",
2828
inspection_models=300,
2929
build_models=100,
30-
expected_return_code=0,
30+
expected_outcomes=((0, True), (1, False)),
3131
expected_fragments=(
3232
"| `plan --json` |",
3333
"| `build (empty warehouse)` |",
3434
"| `lineage column trace` |",
3535
"Benchmark projects are generated per side",
36-
"**Result: passed.**",
36+
"**Result: ",
3737
),
3838
expected_marked_projects=(
3939
"baseline/build",
@@ -96,10 +96,12 @@ def test_given_two_installations_when_comparing_release_performance_then_reports
9696
== test_case.expected_marked_projects
9797
)
9898
output: str = result.stdout + result.stderr
99-
assert result.returncode == test_case.expected_return_code, output
10099
markdown: str = summary.read_text(encoding="utf-8")
101100
for fragment in test_case.expected_fragments:
102101
assert fragment in markdown
102+
assert (result.returncode, "**Result: passed.**" in markdown) in (
103+
test_case.expected_outcomes
104+
), output
103105
recorded: dict[str, object] = json.loads(evidence.read_text(encoding="utf-8"))
104106
assert [command["name"] for command in recorded["commands"]] == [
105107
command.name for command in BENCHMARK_COMMANDS

‎tests/unit/scripts/release_performance/_helpers/test_verdict.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,24 @@
6363
),
6464
expected_regressed=(False, True, False),
6565
),
66+
MetricVerdictTestCase(
67+
description="a wall-only regression at CPU parity fails on wall alone",
68+
comparison=comparison(
69+
name="build (empty warehouse)",
70+
baseline=((10.0, 6.4, 330),) * 3,
71+
candidate=((13.14, 6.36, 330),) * 3,
72+
),
73+
expected_regressed=(True, False, False),
74+
),
75+
MetricVerdictTestCase(
76+
description="a wall-only slowdown under the ratio limit at CPU parity passes",
77+
comparison=comparison(
78+
name="build (empty warehouse)",
79+
baseline=((10.0, 6.4, 330),) * 3,
80+
candidate=((12.4, 6.4, 330),) * 3,
81+
),
82+
expected_regressed=(False, False, False),
83+
),
6684
MetricVerdictTestCase(
6785
description="one slow outlier does not move the median time",
6886
comparison=comparison(

0 commit comments

Comments
 (0)