Skip to content

Commit 63ebd6b

Browse files
committed
test: stabilize fresh-process cache guards with ratio checks
1 parent c6f61d4 commit 63ebd6b

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

‎tests/e2e/src/sqlbuild/cli/commands/main/compile/_test_types.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ class FreshProcessCompileCachePerformanceGuardTestCase:
138138
expected_warm_max_wall_seconds: float
139139
expected_edit_max_wall_seconds: float
140140
expected_max_warm_to_cold_ratio: float
141+
expected_max_edit_to_cold_ratio: float
141142
expected_max_rss_bytes: int
142143
expected_max_cache_bytes: int
143144
expected_cold_fingerprint: str

‎tests/e2e/src/sqlbuild/cli/commands/main/compile/test_fresh_process_compile_cache_performance.py‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
_LOGGER: logging.Logger = logging.getLogger(__name__)
2626
_GIB: int = 1024 * 1024 * 1024
2727
_MIB: int = 1024 * 1024
28-
_MAX_WARM_TO_COLD_RATIO: float = 0.67
28+
_MAX_WARM_TO_COLD_RATIO: float = 0.65
29+
_MAX_EDIT_TO_COLD_RATIO: float = 0.60
2930

3031

3132
@pytest.mark.performance
@@ -42,10 +43,11 @@
4243
macro_count=500,
4344
test_count=2_945,
4445
audit_count=5_056,
45-
expected_cold_max_wall_seconds=13.5,
46-
expected_warm_max_wall_seconds=6.75,
47-
expected_edit_max_wall_seconds=6.5,
46+
expected_cold_max_wall_seconds=14.5,
47+
expected_warm_max_wall_seconds=8.25,
48+
expected_edit_max_wall_seconds=7.25,
4849
expected_max_warm_to_cold_ratio=_MAX_WARM_TO_COLD_RATIO,
50+
expected_max_edit_to_cold_ratio=_MAX_EDIT_TO_COLD_RATIO,
4951
expected_max_rss_bytes=2 * _GIB,
5052
expected_max_cache_bytes=96 * _MIB,
5153
expected_cold_fingerprint=(
@@ -77,6 +79,7 @@
7779
expected_warm_max_wall_seconds=13.5,
7880
expected_edit_max_wall_seconds=12.0,
7981
expected_max_warm_to_cold_ratio=_MAX_WARM_TO_COLD_RATIO,
82+
expected_max_edit_to_cold_ratio=_MAX_EDIT_TO_COLD_RATIO,
8083
expected_max_rss_bytes=2 * _GIB,
8184
expected_max_cache_bytes=160 * _MIB,
8285
expected_cold_fingerprint=(
@@ -104,10 +107,11 @@
104107
macro_count=1_667,
105108
test_count=9_816,
106109
audit_count=16_855,
107-
expected_cold_max_wall_seconds=39.0,
108-
expected_warm_max_wall_seconds=21.5,
109-
expected_edit_max_wall_seconds=18.5,
110+
expected_cold_max_wall_seconds=42.5,
111+
expected_warm_max_wall_seconds=24.5,
112+
expected_edit_max_wall_seconds=22.0,
110113
expected_max_warm_to_cold_ratio=_MAX_WARM_TO_COLD_RATIO,
114+
expected_max_edit_to_cold_ratio=_MAX_EDIT_TO_COLD_RATIO,
111115
expected_max_rss_bytes=2 * _GIB,
112116
expected_max_cache_bytes=320 * _MIB,
113117
expected_cold_fingerprint=(
@@ -187,6 +191,10 @@ def test_given_semantic_project_when_compiling_across_processes_then_cache_is_in
187191
)
188192
for measurement in (result.leaf_edit, result.macro_edit):
189193
assert measurement.elapsed_seconds < test_case.expected_edit_max_wall_seconds
194+
assert (
195+
measurement.elapsed_seconds / result.cold.elapsed_seconds
196+
<= test_case.expected_max_edit_to_cold_ratio
197+
)
190198
assert result.project_config_edit.elapsed_seconds < test_case.expected_cold_max_wall_seconds
191199
assert result.cache_bytes < test_case.expected_max_cache_bytes
192200

0 commit comments

Comments
 (0)