Good test.
I'd tweak it (as shown below) though to reduce the timeout and memory.
We don't care about false positive timeouts, and 6M should both be enough 
headroom,
and fillable within 0.5s on modern systems.
Also we don't need /dev/full, only the more ubiquitous /dev/zero.

With 8 x 2 seconds, it would be best to tag with expensive_
but 4 seconds CPU isn't too bad, so it's probably fine to leave untagged.

thanks,
Padraig

diff --git a/tests/basenc/basenc-bounded-memory.sh 
b/tests/basenc/basenc-bounded-memory.sh
index 6bd7f6e35..8ac2d1e1a 100755
--- a/tests/basenc/basenc-bounded-memory.sh
+++ b/tests/basenc/basenc-bounded-memory.sh
@@ -19,16 +19,14 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ basenc

-test -w /dev/full && test -c /dev/full || skip_ 'this system lacks /dev/full'
-
 vm=$(get_min_ulimit_v_ basenc /dev/null)

 # Check all except for --base58.
 for algorithm in '--base64' '--base64url' '--base32' '--base32hex' '--base16' \
                  '--base2msbf' '--base2lsbf' '--z85'; do
-  timeout 2 $SHELL -c \
-    "(ulimit -v $(($vm+24000)) \
-      && basenc $algorithm </dev/full >/dev/null 2>err)"
+  timeout 0.5 $SHELL -c \
+    "(ulimit -v $(($vm+6000)) \
+      && basenc $algorithm </dev/zero >/dev/null 2>err)"
   ret=$?
   test -f err || skip_ 'shell ulimit failure'
   test $ret = 124 || {

Reply via email to