mirror of
https://github.com/harivansh-afk/deskctl.git
synced 2026-04-15 09:01:15 +00:00
fix termination bug
This commit is contained in:
parent
3a8d9f90c1
commit
3ca6c90eaf
3 changed files with 96 additions and 17 deletions
|
|
@ -114,6 +114,31 @@ fn daemon_start_recovers_from_stale_socket() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn daemon_init_failure_cleans_runtime_state() -> Result<()> {
|
||||
let _guard = env_lock_guard();
|
||||
let session = TestSession::new("daemon-init-failure")?;
|
||||
|
||||
let output = session.run_daemon([("XDG_SESSION_TYPE", "x11"), ("DISPLAY", ":99999")])?;
|
||||
assert!(!output.status.success(), "daemon startup should fail");
|
||||
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
assert!(
|
||||
stderr.contains("Failed to initialize daemon state"),
|
||||
"unexpected stderr: {stderr}"
|
||||
);
|
||||
assert!(
|
||||
!session.socket_path().exists(),
|
||||
"failed startup should remove the socket path"
|
||||
);
|
||||
assert!(
|
||||
!session.pid_path().exists(),
|
||||
"failed startup should remove the pid path"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wait_window_returns_matched_window_payload() -> Result<()> {
|
||||
let _guard = env_lock_guard();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue