mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-20 00:55:43 +00:00
Watch Folder renders take the host's memory budget; docs and test comment (#3941 review)
This commit is contained in:
1 parent
0d9c69563f
commit
98ada1e8ff
5 files changed
+59
-6
No files matched your search
@@ -40,6 +40,21 @@ fn tmp(name: &str) -> PathBuf {
|
||||
canonical(&d).unwrap_or(d).join(name)
|
||||
}
|
||||
|
||||
/// #3941: a command-line session reads the system's memory at start, so its caches share the
|
||||
/// budget of the installed RAM (as in the desktop app), not the budget for unknown RAM.
|
||||
#[test]
|
||||
fn the_caches_follow_the_installed_ram() {
|
||||
let Some(memory) = effectcraft_engine::sysinfo::memory() else {
|
||||
eprintln!("the system's memory can't be read here: not checked");
|
||||
return;
|
||||
};
|
||||
let v = ok_json(&["exec", "help.systemReport", r#"{"quiet":true}"#, "--empty"]);
|
||||
let reduced = v["caches"]["reduced"].as_bool().unwrap();
|
||||
let want = effectcraft_engine::prefs::Prefs::default().memory_budget(Some(memory), reduced).bytes;
|
||||
let gb = |b: usize| format!("{:.1} GB", b as f64 / (1u64 << 30) as f64);
|
||||
assert_eq!(v["caches"]["budget"], gb(want), "{v}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn info_and_commands() {
|
||||
let v = ok_json(&["info"]);
|
||||
|
||||
Reference in new issue
Block a user