fix tests/worker-task-abort.rs - correctly spawn command socket

And wait for the task.

Note: The test is still ignored (but works now when run a root)
This commit is contained in:
Dietmar Maurer 2021-09-14 10:42:44 +02:00
parent ccc3896ff3
commit 36c6e7bb82
1 changed files with 9 additions and 2 deletions

View File

@ -31,7 +31,8 @@ fn garbage_collection(worker: &server::WorkerTask) -> Result<(), Error> {
} }
#[test] #[ignore] #[test]
#[ignore]
fn worker_task_abort() -> Result<(), Error> { fn worker_task_abort() -> Result<(), Error> {
server::create_task_log_dirs()?; server::create_task_log_dirs()?;
@ -57,6 +58,11 @@ fn worker_task_abort() -> Result<(), Error> {
return; return;
} }
if let Err(err) = commando_sock.spawn() {
eprintln!("unable to spawn command socket - {}", err);
return;
}
let errmsg = errmsg1.clone(); let errmsg = errmsg1.clone();
let res = server::WorkerTask::new_thread( let res = server::WorkerTask::new_thread(
"garbage_collection", "garbage_collection",
@ -87,7 +93,8 @@ fn worker_task_abort() -> Result<(), Error> {
Ok(wid) => { Ok(wid) => {
println!("WORKER: {}", wid); println!("WORKER: {}", wid);
server::abort_worker_async(wid.parse::<UPID>().unwrap()); server::abort_worker_async(wid.parse::<UPID>().unwrap());
} server::wait_for_local_worker(&wid).await.unwrap();
}
} }
}); });