Skip to content

Commit dbba844

Browse files
committed
test: bound the warm run after a project-wide rewrite separately
1 parent 126bd04 commit dbba844

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
_GIB: int = 1024 * 1024 * 1024
2727
_MIB: int = 1024 * 1024
2828
_MAX_WARM_TO_COLD_RATIO: float = 0.70
29+
# The warm run after a project-wide rewrite re-reads every unchanged artifact to compare it; under
30+
# the CI memory cap those files have already left the page cache, so it reads them back from disk.
31+
_MAX_AFTER_PROJECT_REWRITE_TO_COLD_RATIO: float = 0.8
2932
_MAX_EDIT_TO_COLD_RATIO: float = 0.70
3033
# Writing the cache during a cold compile must stay a small same-runner cost over --no-cache.
3134
_MAX_CACHE_WRITE_CPU_OVERHEAD_RATIO: float = 1.10
@@ -210,10 +213,15 @@ def test_given_semantic_project_when_compiling_across_processes_then_cache_is_in
210213
result.after_project_config_edit,
211214
):
212215
assert measurement.elapsed_seconds < test_case.expected_warm_max_wall_seconds
216+
for measurement in (result.warm, result.after_leaf_edit, result.after_macro_edit):
213217
assert (
214218
measurement.elapsed_seconds / result.cold.elapsed_seconds
215219
<= test_case.expected_max_warm_to_cold_ratio
216220
)
221+
assert (
222+
result.after_project_config_edit.elapsed_seconds / result.cold.elapsed_seconds
223+
<= _MAX_AFTER_PROJECT_REWRITE_TO_COLD_RATIO
224+
)
217225
for measurement in (result.leaf_edit, result.macro_edit):
218226
assert measurement.elapsed_seconds < test_case.expected_edit_max_wall_seconds
219227
assert (

0 commit comments

Comments
 (0)