[RFC][PATCH] Increase time-out values in test cases
Helge Deller
deller at gmx.de
Fri Aug 11 08:46:25 UTC 2023
This is a RFC, if strace should really be so strict on the various
time-out values in some tests, and if those values should be increased.
The reasoning is, that if strace is built on package-builder machines
(e.g. in my case the debian machines building the debian strace
package), the build is happening on a machine which may concurrently
build other packages (in another chroot) in parallel.
If this happens, it's not guaranteed that a "sleep 1" returns in 1.0x or
1.1x seconds. An example can be seen here:
https://buildd.debian.org/status/fetch.php?pkg=strace&arch=hppa&ver=6.4-0.1&stamp=1691669659&raw=0
where the strace-r test returned in 1.469987 seconds (which should be
basically OK too), but due to the expected return values the test fails
and the package isn't successfully built.
So, the time until a test is finished may be undeterministic in such
scenarios.
I'm not asking to apply the patch below as-is, it's just
meant to show the issue and help in this RFC.
Maybe there is another way to work around that issue?
Helge
Signed-off-by: Helge Deller <deller at gmx.de>
---
diff --git a/tests/count.test b/tests/count.test
index c129a9366..fe0420130 100755
--- a/tests/count.test
+++ b/tests/count.test
@@ -30,8 +30,8 @@ grep_log()
}
GENERIC=' *[^ ]+ +0\.0[^n]*nanosleep *'
-WALLCLOCK=' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep *'
-WALLCLOCK1='100\.00 +(1\.[01]|0\.99)[^n]*nanosleep'
+WALLCLOCK=' *[^ ]+ +(1\.[01234]|0\.99)[^n]*nanosleep *'
+WALLCLOCK1='100\.00 +(1\.[01234]|0\.99)[^n]*nanosleep'
HALFCLOCK=' *[^ ]+ +0\.[567][^n]*nanosleep *'
grep_log "$GENERIC" -c
diff --git a/tests/init.sh b/tests/init.sh
index a626b92b8..0913b433e 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -604,7 +604,7 @@ fi
: "${STRACE_EXE:=$STRACE}"
export STRACE_EXE
-: "${TIMEOUT_DURATION:=1500}"
+: "${TIMEOUT_DURATION:=3000}"
: "${SLEEP_A_BIT:=sleep 1}"
[ -z "${VERBOSE-}" ] ||
diff --git a/tests/strace-T_upper.expected b/tests/strace-T_upper.expected
index 1ea020465..ee008372e 100644
--- a/tests/strace-T_upper.expected
+++ b/tests/strace-T_upper.expected
@@ -1 +1 @@
-nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0 <(1\.[01]|0\.9)[[:digit:]]{5}>
+nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0 <(1\.[0123456]|0\.9)[[:digit:]]{5}>
diff --git a/tests/strace-r.expected b/tests/strace-r.expected
index 2a5b97733..e370ecaa4 100644
--- a/tests/strace-r.expected
+++ b/tests/strace-r.expected
@@ -1,2 +1,2 @@
[ ]{5}0\.0{6} execve\("\.\./sleep", \["\.\./sleep", "1"\], 0x[[:xdigit:]]* /\* [[:digit:]]* vars \*/\) = 0
-[ ]{5}(1\.[01]|0\.9)[[:digit:]]{5} \+\+\+ exited with 0 \+\+\+
+[ ]{5}(1\.[0123456]|0\.9)[[:digit:]]{5} \+\+\+ exited with 0 \+\+\+
More information about the Strace-devel
mailing list