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 port
pull/1256/head
John Safranek 2026-09-15 10:42:58 -07:00
parent 399c83b1b6
commit 3a3f0aa76e
3 changed files with 9 additions and 5 deletions

View File

@ -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")

View 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

View File

@ -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))