Skip to content

Commit

Permalink
Fix spawning process test
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryAstafyev committed Apr 17, 2024
1 parent 016cd81 commit cc09832
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 27 deletions.
60 changes: 37 additions & 23 deletions application/apps/indexer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions application/apps/indexer/sources/src/command/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ impl ProcessSource {
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.stdin(Stdio::piped())
.kill_on_drop(true)
.spawn()
.map_err(|e| ProcessError::Setup(format!("{e}")))
}
Expand Down Expand Up @@ -239,12 +240,10 @@ async fn test_process() -> Result<(), ProcessError> {
.is_some()
{
assert!(!process_source.current_slice().is_empty());
// println!(
// "{}",
// std::str::from_utf8(process_source.current_slice()).unwrap()
// );
process_source.consume(process_source.current_slice().len());
}
// By some reasons during test sometimes process stay alive and as result
let _ = process_source.process.kill().await;
Ok(())
}
Err(err) => Err(err),
Expand Down

0 comments on commit cc09832

Please sign in to comment.