Skip to content

Commit 713037a

Browse files
committed
cluster-launch-installer-e2e: Wait on the create process ID
From the POSIX spec [1]: If the wait utility is invoked with no operands, it shall wait until all process IDs known to the invoking shell have terminated and exit with a zero exit status. If one or more pid operands are specified that represent known process IDs, the wait utility shall wait until all of them have terminated. If one or more pid operands are specified that represent unknown process IDs, wait shall treat them as if they were known process IDs that exited with exit status 127. The exit status returned by the wait utility shall be the exit status of the process requested by the last pid operand. Because the bare 'wait' from d862f6f (cluster-launch-installer-e2e: Restore EXIT and TERM signal handlers, 2018-10-17, #1957) contained no PID arguments, it was returning zero even when the install command failed. Here's a simple example demonstrating the effect: $ false & $ wait $ echo $? 0 With this command, we use $! to get the installer's process PID [2], and pass that to 'wait'. Now the wait call will exit with the installer exit status, and because it's the last command in the shell script, the script will also exit with the installer exit status. Here's a simple example demonstrating the new approach: $ false & $ wait "$!" $ echo $? 1 [1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/wait.html [2]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_02
1 parent 7495171 commit 713037a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ objects:
269269
270270
export _CI_ONLY_STAY_AWAY_OPENSHIFT_INSTALL_AWS_USER_TAGS="{\"expirationDate\": \"$(date -d '4 hours' --iso=minutes --utc)\"}"
271271
/bin/openshift-install --dir=/tmp/artifacts/installer --log-level=debug cluster &
272-
wait
272+
wait "$!"
273273
274274
# Performs cleanup of all created resources
275275
- name: teardown

0 commit comments

Comments
 (0)