From e9fb41fdc8a4c5d8e9cbe7883424af56b30fb6a8 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Sat, 2 Mar 2019 21:59:38 -0500 Subject: [PATCH] test: shell: Fix rare breakage in load test For some reason the load is occasionally zero. This broke the regexp. Let's see if this ever happens with the other digits. --- test/shell/load0.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/shell/load0.sh b/test/shell/load0.sh index cb61f62b..ac42bed0 100755 --- a/test/shell/load0.sh +++ b/test/shell/load0.sh @@ -12,7 +12,8 @@ set -o pipefail # Precision varies (eg: 4, 9 or 11 digits). Hence no strict check for precision but # anything above 3 will do. It is assumed we will hardly ever get a precision lower than 3 digits # from the current implementations. Otherwise this test would need to be revised. -regex="load average: [0-9]\.[0-9]{3,}, [0-9]\.[0-9]{3,}, [0-9]\.[0-9]{3,}" +# We once got: 'load average: 0, 0.28515625, 0.349609375'. +regex="load average: ([0-9]\.[0-9]{3,})|0, [0-9]\.[0-9]{3,}, [0-9]\.[0-9]{3,}" tmpdir="$($mktemp --tmpdir -d tmp.XXX)" if [[ ! "$tmpdir" =~ "/tmp" ]]; then