Rarely (but these tests now get run often), it seems like we catch the
shell between its fork and exec of sleep, which counts as false
positives for killall/pidof. Since we don't actually need to sleep, just
have the shell script spin instead.
---
 tests/killall.test | 2 +-
 tests/pidof.test   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
From 6bc69828af9314defc246590899935eed4654ec6 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Mon, 16 Sep 2019 13:14:42 -0700
Subject: [PATCH] killall.test, pidof.test: deflake.

Rarely (but these tests now get run often), it seems like we catch the
shell between its fork and exec of sleep, which counts as false
positives for killall/pidof. Since we don't actually need to sleep, just
have the shell script spin instead.
---
 tests/killall.test | 2 +-
 tests/pidof.test   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/killall.test b/tests/killall.test
index b15dbf0f..6d9c9f2c 100644
--- a/tests/killall.test
+++ b/tests/killall.test
@@ -6,7 +6,7 @@
 
 echo "#!$(which sh)
 while true; do
-  sleep 0.1
+  :
 done" > toybox.killall.test.script
 chmod a+x toybox.killall.test.script
 cp toybox.killall.test.script toybox.test
diff --git a/tests/pidof.test b/tests/pidof.test
index 7de31fc2..30a54322 100644
--- a/tests/pidof.test
+++ b/tests/pidof.test
@@ -10,7 +10,7 @@
 
 echo "#!$(which sh)
 while true; do
-  sleep 0.1
+  :
 done" > toybox.pidof.test.script
 chmod a+x toybox.pidof.test.script
 cp toybox.pidof.test.script pidof.test
-- 
2.23.0.237.gc6a4ce50a0-goog

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

Reply via email to