aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-07-25 14:24:41 -0700
committerRob Landley <rob@landley.net>2019-07-25 21:31:23 -0500
commit90ba72902d5f65a398d6954b20bb10042de57270 (patch)
tree959a575a286c42de6476a70d889d0f1574e5acf9 /tests
parentb891b49e08082f1385ae7150063841c0766f53c8 (diff)
downloadtoybox-90ba72902d5f65a398d6954b20bb10042de57270.tar.gz
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.)
Diffstat (limited to 'tests')
-rw-r--r--tests/killall.test12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/killall.test b/tests/killall.test
index 7e171d46..8302a574 100644
--- a/tests/killall.test
+++ b/tests/killall.test
@@ -11,10 +11,14 @@ done" > toybox.killall.test.script
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