Skip to content

Conversation

@yoshuawuyts
Copy link
Member

Depends on #33, closes #8. Adds endpoints tests to the sample.

Comment on lines +47 to +63
fn kill_process_by_port(port: u16) {
let output = Command::new("lsof")
.args(["-i", &format!("tcp:{}", port), "-t"])
.output()
.expect("Failed to execute lsof");

if let Ok(pid) = String::from_utf8(output.stdout) {
if !pid.trim().is_empty() {
Command::new("kill")
.arg("-9")
.arg(pid.trim())
.output()
.expect("Failed to kill process");
}
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbf, this is probably bust and we should replace it with a Wasmtime library instance.

We should probably have some "wasmtime test" library that makes this easier for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exercise a unit test in CI

2 participants