Skip to content

Commit

Permalink
[hotfix][build] Fixes error message when printing the 15 biggest dire…
Browse files Browse the repository at this point in the history
…ctories
  • Loading branch information
XComp committed Feb 7, 2024
1 parent 74057eb commit cfdf05c
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion flink-end-to-end-tests/test-scripts/test-runner-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,16 @@ function log_environment_info {
df -h

echo "##[group]Top 15 biggest directories in terms of used disk space"
du -a . | sort -n -r | head -n 15
local pipefail_config
pipefail_config="$(get_current_set_option pipefail)"

# GitHub Actions runs with pipefail enabled which makes
# the piped command fail (because head will exit with 141)
set +o pipefail

du -ah --exclude="proc" -t100M . | sort -h -r | head -n 15

eval "set ${pipefail_config}o pipefail"

if sudo -n true 2>/dev/null; then
echo "Allocated ports"
Expand All @@ -133,6 +142,23 @@ function log_environment_info {
echo "##[endgroup]"
}

# The echo'd character can be used to reset the config parameter
# to it's initial state again, e.g.:
# sign="$(get_current_set_option pipefail)
# set -o pipefail
# set ${sign}o pipefail
function get_current_set_option {
if [ $# -eq 0 ]; then
echo "[ERROR] No parameter was specified for get_current_set_option."
exit 1
elif [ "$(set -o | grep "$1" | grep -c "on$")" -eq 1 ]; then
# set -o
echo "-"
else
echo "+"
fi
}

# Shuts down cluster and reverts changes to cluster configs
function cleanup_proc {
shutdown_all
Expand Down

0 comments on commit cfdf05c

Please sign in to comment.