From 90ba72902d5f65a398d6954b20bb10042de57270 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 25 Jul 2019 14:24:41 -0700 Subject: 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.) --- tests/killall.test | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3