Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/diag.sh:wait_startup_pid() uses $1 in while test ! -f $1 condition #4579

Open
Whissi opened this issue Apr 24, 2021 · 0 comments
Open

Comments

@Whissi
Copy link
Contributor

Whissi commented Apr 24, 2021

While testing if latest libfaketime-0.9.9 works with rsyslog linked against jemalloc (issue #2099), spoiler alert, it still doesn't -- problem is still there, I noticed

09:06:20[581]  ABORT! Timeout waiting on startup (pid file rstb_626453_4c7c8fca4VZZ:.pid)
ls: cannot access 'rstb_626453_4c7c8fca4VZZ:.pid': No such file or directory
cat: 'rstb_626453_4c7c8fca4VZZ:.pid': No such file or directory
error: list of process IDs must follow -p

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

I think that's because of a logic failure in

rsyslog/tests/diag.sh

Lines 294 to 310 in 47ad372

# wait for appearance of a specific pid file, given as $1
wait_startup_pid() {
if [ "$1" == "" ]; then
echo "FAIL: testbench bug: wait_startup_called without \$1"
error_exit 100
fi
while test ! -f $1; do
$TESTTOOL_DIR/msleep 100 # wait 100 milliseconds
if [ $(date +%s) -gt $(( TB_STARTTEST + TB_TEST_MAX_RUNTIME )) ]; then
printf '%s ABORT! Timeout waiting on startup (pid file %s)\n' "$(tb_timestamp)" "$1"
ls -l "$1"
ps -fp $(cat "$1")
error_exit 1
fi
done
printf '%s %s found, pid %s\n' "$(tb_timestamp)" "$1" "$(cat $1)"
}
where we are using $1 in line 304 and 305 while we are in loop with condition while test ! -f $1; do in line 300.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant