Skip to content

Commit

Permalink
try with fix from bats site
Browse files Browse the repository at this point in the history
  • Loading branch information
dmusican committed Dec 4, 2022
1 parent 05c9450 commit 25d8279
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions othertests/startup-shutdown.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ setup() {
git clone -q ../remote
}

function close_non_std_fds() {
local open_fds non_std_fds=()
get_open_fds
for fd in "${open_fds[@]}"; do
if [[ $fd -gt 2 ]]; then
non_std_fds+=("$fd")
fi
done
close_fds "${non_std_fds[@]}"
}

teardown() {
echo '# Teardown started' >&3
# Remove testing directories
Expand All @@ -34,5 +45,8 @@ teardown() {
# Must kill the entire tree of processes generated
pkill -15 -P "$GITWATCH_PID"

close_non_std_fds

echo '# Teardown complete' >&3

}

0 comments on commit 25d8279

Please sign in to comment.