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

Rollback #14510 because it causes remote test execution to fail #17147

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions tools/test/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,18 @@ fi
childPid=$!

# Cleanup helper
# Assume that we don't have drastically reduced abilities to communicate signals
# to our parent process. kill()ability means existence.
( while kill -0 $PPID &> /dev/null; do # magic 0 sigspec tests deliverability only
# It would be nice to use `kill -0 $PPID` here, but when whatever called this
# is running as a different user (as happens in remote execution) that will
# return an error, causing us to prematurely reap a running test.
( if ! (ps -p $$ &> /dev/null || [ "`pgrep -a -g $$ 2> /dev/null`" != "" ] ); then
# `ps` is known to be unrunnable in the darwin sandbox-exec environment due
# to being a set-uid root program. pgrep exists in most environments, but not
# universally. In the event that we find ourselves running in an environment
# where *neither* exists, we have no reliable way to check if our parent is
# still alive - so simply disable this cleanup routine entirely.
exit 0
fi
while ps -p $$ &> /dev/null || [ "`pgrep -a -g $$ 2> /dev/null`" != "" ]; do
sleep 10
done
# Parent process not found - we've been abandoned! Clean up test processes.
Expand Down