[libFuzzer] Kill by session ID in merge-sigusr.test.
Ensures that parent and all child processes are killed at once.
@@ -23,10 +23,10 @@ RUN: echo m > %t/C2/g
RUN: echo n > %t/C2/g
RUN: echo o > %t/C2/g
-RUN: %run %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2>%t/log & export PID=$!
+# Run in new session so we can easily kill child processes all at once.
+RUN: setsid %run %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2>%t/log & export PID=$!
RUN: sleep 3
-RUN: pkill -SIGUSR2 -P $PID
-RUN: kill -SIGUSR2 $PID
+RUN: kill -SIGUSR2 -$(ps -o sess= $PID | grep -o '[0-9]*')
RUN: wait $PID || true
RUN: cat %t/log | FileCheck %s --dump-input=fail
RUN: grep C2/g %t/MCF
