mirror of https://github.com/wolfSSL/wolfssh.git
scripts: widen the ready-file wait to ten seconds
The sftp, scp and get-put scripts wait for the echoserver to publish its port before connecting. Two seconds is not enough for a libtool re-exec, the dynamic linker and the sample-key parse with a dozen sibling test jobs on the machine, so a parallel make check failed them at their first scenario. Ten seconds matches what sshclient.test already allows. - raise the three wait loops from 20 to 100 iterations of 0.1 seconds - test -s, not -e, after the loop in scp.test and get-put.test: the ready file is created empty and the port written afterward, so -e can take a file caught mid-write and yield an empty portpull/1256/head
parent
399c83b1b6
commit
3a3f0aa76e
|
|
@ -45,12 +45,14 @@ READY_COUNTER=0
|
|||
|
||||
|
||||
wait_for_server() {
|
||||
while [ ! -s "$READY_FILE" ] && [ "$READY_COUNTER" -lt 20 ]; do
|
||||
while [ ! -s "$READY_FILE" ] && [ "$READY_COUNTER" -lt 100 ]; do
|
||||
sleep 0.1
|
||||
READY_COUNTER=$((READY_COUNTER+ 1))
|
||||
done
|
||||
|
||||
if test -e "$READY_FILE"
|
||||
# -s, not -e: the echoserver creates the file empty and writes the
|
||||
# port afterward, so -e can catch it mid-write and yield no port
|
||||
if [ -s "$READY_FILE" ]
|
||||
then
|
||||
# get created port 0 ephemeral port
|
||||
PORT=$(cat "$READY_FILE")
|
||||
|
|
|
|||
|
|
@ -25,13 +25,15 @@ fi
|
|||
create_port() {
|
||||
# each server gets its own wait budget, the count must not carry over
|
||||
counter=0
|
||||
while [ ! -s "$ready_file" ] && [ "$counter" -lt 20 ]; do
|
||||
while [ ! -s "$ready_file" ] && [ "$counter" -lt 100 ]; do
|
||||
echo -e "waiting for ready file..."
|
||||
sleep 0.1
|
||||
counter=$((counter+ 1))
|
||||
done
|
||||
|
||||
if test -e $ready_file; then
|
||||
# -s, not -e: the echoserver creates the file empty and writes the
|
||||
# port afterward, so -e can catch it mid-write and yield no port
|
||||
if [ -s "$ready_file" ]; then
|
||||
echo -e "found ready file, starting client..."
|
||||
|
||||
# get created port 0 ephemeral port
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ create_port() {
|
|||
# counted per server start, so a slow first start cannot eat the wait
|
||||
# the later ones need
|
||||
counter=0
|
||||
while [ ! -s "$ready_file" ] && [ "$counter" -lt 20 ]; do
|
||||
while [ ! -s "$ready_file" ] && [ "$counter" -lt 100 ]; do
|
||||
echo "waiting for ready file..."
|
||||
sleep 0.1
|
||||
counter=$((counter+ 1))
|
||||
|
|
|
|||
Loading…
Reference in New Issue