mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-26 17:03:09 +00:00
fix(appd): set WEFT_DISABLE_CGROUP in supervisor test
In environments where XDG_RUNTIME_DIR/systemd/private exists but the user systemd session is not functional, systemd_cgroup_available() returns true and the test script is wrapped with systemd-run, which fails immediately, causing ChildStdout to return EOF before READY. Set WEFT_DISABLE_CGROUP=1 for the duration of the test and restore it on exit.
This commit is contained in:
parent
54b5fb662b
commit
379d0886bd
1 changed files with 9 additions and 1 deletions
|
|
@ -813,8 +813,12 @@ mod tests {
|
|||
std::fs::set_permissions(&script, std::fs::Permissions::from_mode(0o755)).unwrap();
|
||||
|
||||
let prior = std::env::var("WEFT_RUNTIME_BIN").ok();
|
||||
let prior_cgroup = std::env::var("WEFT_DISABLE_CGROUP").ok();
|
||||
// SAFETY: single-threaded test (flavor = "current_thread"); no concurrent env access.
|
||||
unsafe { std::env::set_var("WEFT_RUNTIME_BIN", &script) };
|
||||
unsafe {
|
||||
std::env::set_var("WEFT_RUNTIME_BIN", &script);
|
||||
std::env::set_var("WEFT_DISABLE_CGROUP", "1");
|
||||
}
|
||||
|
||||
let registry: Registry = Arc::new(Mutex::new(SessionRegistry::default()));
|
||||
let mut rx = registry.lock().await.subscribe();
|
||||
|
|
@ -856,6 +860,10 @@ mod tests {
|
|||
Some(v) => std::env::set_var("WEFT_RUNTIME_BIN", v),
|
||||
None => std::env::remove_var("WEFT_RUNTIME_BIN"),
|
||||
}
|
||||
match prior_cgroup {
|
||||
Some(v) => std::env::set_var("WEFT_DISABLE_CGROUP", v),
|
||||
None => std::env::remove_var("WEFT_DISABLE_CGROUP"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue