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(-)
From 5efea4eea7ee67e0d3a2f0813244e4f7fdfcef95 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Thu, 25 Jul 2019 14:24:41 -0700
Subject: [PATCH 1/2] 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(-)

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
-- 
2.22.0.709.g102302147b-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to