Add a bit more delay before ps calls in plugin persistence tests (#12673)

# Description
I've found that sometimes on Linux, this test fails to find the created
process even after it should definitely be running.

Trying to add a little delay.
This commit is contained in:
Devyn Cairns 2024-04-26 04:24:57 -07:00 committed by GitHub
parent d126793290
commit 822c434c12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,6 +43,7 @@ fn plugin_process_exits_after_stop() {
plugin: ("nu_plugin_inc"),
r#"
"2.0.0" | inc -m | ignore
sleep 500ms
let pid = (plugin list).0.pid
if (ps | where pid == $pid | is-empty) {
error make {
@ -101,7 +102,7 @@ fn plugin_process_exits_when_nushell_exits() {
// use nu to check if process exists
assert_eq!(
"0",
nu!(format!("ps | where pid == {pid} | length")).out,
nu!(format!("sleep 500ms; ps | where pid == {pid} | length")).out,
"plugin process {pid} is still running"
);
}