killall.test: fix flakiness.
And when I say "fix", I mean "hack around in the worst possible way".
Android+mksh is often slow enough that we can do the pgrep before the
killed process has actually exited. (I'm seeing roughly 100% failure
rate on cloud x86 emulators, and about 75% on a real Pixel 2.)
diff --git a/tests/killall.test b/tests/killall.test
index 7e171d4..8302a57 100644
--- a/tests/killall.test
+++ b/tests/killall.test
@@ -11,10 +11,14 @@
chmod a+x toybox.killall.test.script
cp toybox.killall.test.script toybox.test
-./toybox.test &
-testing "short name" "killall toybox.test && echo killed ; pgrep -l toybox.test || echo really" "killed\nreally\n" "" ""
+tst=toybox.test
+./$tst &
+testing "short name" "killall $tst && echo killed ; sleep 0.1 ; \
+ pgrep -l $tst || echo really" "killed\nreally\n" "" ""
-./toybox.killall.test.script &
-testing "long name" "killall toybox.killall.test.script && echo killed ; pgrep -l toybox.killall.test.script || echo really" "killed\nreally\n" "" ""
+tst=toybox.killall.test.script
+./$tst &
+testing "long name" "killall $tst && echo killed ; sleep 0.1 ; \
+ pgrep -l $tst || echo really" "killed\nreally\n" "" ""
rm -f toybox.killall.test.script toybox.test