Prevent the TIMESTAMP tests from sporadically failing due do seconds overflow

This commit is contained in:
Gerhard Rieger 2021-10-30 09:34:34 +02:00
parent 196d74752d
commit dc7afeb0f5
2 changed files with 21 additions and 1 deletions

View file

@ -1,4 +1,8 @@
 
Testing:
Prevent the TIMESTAMP tests from sporadically failing due do seconds
overflow
####################### V 1.7.4.1: ####################### V 1.7.4.1:
Corrections: Corrections:

18
test.sh
View file

@ -10361,7 +10361,15 @@ CMD0="$TRACE $SOCAT $opts -d -d -d -u $KEYW-RECV:$tra,reuseaddr,$SCM_RECV -"
CMD1="$TRACE $SOCAT $opts -u - $KEYW-SENDTO:$tsa,$SCM_ENABLE" CMD1="$TRACE $SOCAT $opts -u - $KEYW-SENDTO:$tsa,$SCM_ENABLE"
printf "test $F_n $TEST... " $N printf "test $F_n $TEST... " $N
# is this option supported? # is this option supported?
if $TRACE $SOCAT -hhh |grep "[[:space:]]$SCM_RECV[[:space:]]" >/dev/null; then if $SOCAT -hhh |grep "[[:space:]]$SCM_RECV[[:space:]]" >/dev/null; then
if [ "$SCM_VALUE" = "timestamp" ]; then
secs="$(date '+%S')"
if [ "$secs" -ge 58 -a "$secs" -le 59 ]; then
dsecs=$((60-secs))
#echo "Sleeping $dsecs seconds to avoid minute change in timestamp" >/dev/tty
sleep $dsecs
fi
fi
$CMD0 >"$tf" 2>"${te}0" & $CMD0 >"$tf" 2>"${te}0" &
pid0="$!" pid0="$!"
wait${proto}port $tra 1 wait${proto}port $tra 1
@ -10615,6 +10623,14 @@ CMD1="$TRACE $SOCAT $opts -u - $KEYW-SENDTO:$tsa,$SCM_ENABLE"
printf "test $F_n $TEST... " $N printf "test $F_n $TEST... " $N
# is this option supported? # is this option supported?
if $SOCAT -hhh |grep "[[:space:]]$SCM_RECV[[:space:]]" >/dev/null; then if $SOCAT -hhh |grep "[[:space:]]$SCM_RECV[[:space:]]" >/dev/null; then
if [ "$SCM_VALUE" = "timestamp" ]; then
secs="$(date '+%S')"
if [ "$secs" -ge 58 -a "$secs" -le 59 ]; then
dsecs=$((60-secs))
#echo "Sleeping $dsecs seconds to avoid minute change in timestamp" >/dev/tty
sleep $dsecs
fi
fi
eval "$CMD0 >\"$tf\" 2>\"${te}0\" &" eval "$CMD0 >\"$tf\" 2>\"${te}0\" &"
pid0="$!" pid0="$!"
wait${proto}port $tra 1 wait${proto}port $tra 1