Verified Commit 99177d34 authored by Karel Koci's avatar Karel Koci 🤘
Browse files

tests/c/subprocess: fix potential test fail

It is possible that if we try to immediately kill process that it won't
make it to exec and that way kill might be caught by check library and
reported as failure. By waiting at least short amount we pretty much
make sure that exec happens and that we are killing sleep process rather
our fork.
parent 22bd00a4
Pipeline #72419 passed with stages
in 5 minutes and 16 seconds
......@@ -45,7 +45,7 @@ START_TEST(timeout) {
ck_assert_int_ne(0, subprocvo(1000, fds, "sh", "-c", "while true; do echo Stuff; sleep 1; done", NULL));
// Just to test whole process fast we will also try both timeouts at zero
subproc_kill_t(0);
ck_assert_int_ne(0, subprocvo(0, fds, "sleep", "1", NULL));
ck_assert_int_ne(0, subprocvo(1, fds, "sleep", "2", NULL));
fclose(devnull);
}
END_TEST
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment