From 09fcf494a10c4b1ad2b037d093f571e7462e08c4 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Mon, 5 Jul 2010 08:53:10 +0100 Subject: tests: make tests requiring a delay to pass, more robust * tests/init.cfg: Introduce a retry_delay_() function to repeatedly call a test function that requires a delay. This delay can now be shorter for the common case on fast systems, but will double until a configurable limit it reached before failing on slower systems. * tests/dd/reblock: Use retry_delay_. * tests/misc/cat-buf: Likewise. * tests/misc/stdbuf: Likewise. * tests/tail-2/F-vs-rename: Likewise. * tests/tail-2/flush-initial: Likewise. * tests/tail-2/tail-n0f: Likewise. * tests/tail-2/wait: Likewise. * test/dd/misc: Comment that delay is needed to trigger failure. --- tests/dd/misc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/dd/misc') diff --git a/tests/dd/misc b/tests/dd/misc index 7caacbc7b..ddd7bbd9e 100755 --- a/tests/dd/misc +++ b/tests/dd/misc @@ -87,6 +87,8 @@ fi outbytes=`echo x | dd bs=3 ibs=10 obs=10 conv=sync 2>/dev/null | wc -c` test "$outbytes" -eq 3 || fail=1 +# A delay is required to trigger a failure. +# There might be some missed failures but it's unlikely. (echo a; sleep .1; echo b) \ | env LC_ALL=C dd bs=4 status=noxfer iflag=fullblock >out 2>err || fail=1 printf 'a\nb\n' > out_ok || framework_failure -- cgit v1.2.3-54-g00ecf