pids.sh: Fix spurious failures in test3 cleanup.
PATCH 1/1 pids.sh: Fix spurious failures in test3 cleanup.
Sometimes the possitive testcases were failing in cleanup:
kill: (17773): No such process
1 TBROK: kill -9 17773 failed
The reason is that when we fork pids_task1 the child is running in the particual subgroup and hence it's pid is in the task file. And since the child process did only exit(0) there was a race between the process exit and the stop_pids_task function that read the tasks file.
The fix is obvious, we suspend the pids_task1 child to wait patiently for it's execution.
Signed-off-by Cyril Hrubis <[email protected]>
--- testcases/kernel/controllers/pids/pids_task1.c | 2 ++ 1 file changed, 2 insertions(+)
testcases/kernel/controllers/pids/pids_task1.c +2 -0
@@ -56,5 +56,7 @@ int main(int argc, char **argv)perror ("fork() failed" );return 1 ; } +if (newpid ==0 ) +pause ();return 0 ; }
Signature · 1 line
2.13.6