Starting two netcats at the same time and expecting them to be able to
talk to each is a little optimistic. I don't know whether `sleep .1`
will be sufficient, but wanted to try that before going to `sleep 1`
since neither the toybox nor the github nor the Android infrastructure
is running these tests in parallel, those seconds add up.

Right now this has a ~20% flake rate on the Android infrastructure. I
was able to reproduce the flake locally with `while true ; do make
test_netcat ; done` on my desktop before this patch, but not after.
(Though my desktop is way overpowered for just running that, whereas the
build servers tend to be pretty busy, which is why I reserve the right
to return later with a longer delay.)
---
 tests/netcat.test | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
From 252a6b4b9555e8e0d91097300c7f4ad973f713fc Mon Sep 17 00:00:00 2001
From: Elliott Hughes <e...@google.com>
Date: Sat, 6 Feb 2021 13:05:45 -0800
Subject: [PATCH] netcat.test: reduce flake.

Starting two netcats at the same time and expecting them to be able to
talk to each is a little optimistic. I don't know whether `sleep .1`
will be sufficient, but wanted to try that before going to `sleep 1`
since neither the toybox nor the github nor the Android infrastructure
is running these tests in parallel, those seconds add up.

Right now this has a ~20% flake rate on the Android infrastructure. I
was able to reproduce the flake locally with `while true ; do make
test_netcat ; done` on my desktop before this patch, but not after.
(Though my desktop is way overpowered for just running that, whereas the
build servers tend to be pretty busy, which is why I reserve the right
to return later with a longer delay.)
---
 tests/netcat.test | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/netcat.test b/tests/netcat.test
index 40b51d40..81e6ec7d 100755
--- a/tests/netcat.test
+++ b/tests/netcat.test
@@ -6,6 +6,6 @@
 
 { dd if=/dev/zero bs=4k count=1 2>/dev/null | tr '\0' a; echo b; } > testfile
 testing "more than buffer bytes left at end" \
-  "netcat -lp 1234 wc -c & cat testfile | netcat 127.0.0.1 1234" \
+  "netcat -lp 1234 wc -c & sleep .1 && cat testfile | netcat 127.0.0.1 1234" \
   "4098\n" "" ""
 rm -f testfile
-- 
2.30.0.478.g8a0d178c01-goog

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to