Skip to content

Commit f1a038c

Browse files
committed
bash: skip blocking venv cleanup on windows
1 parent 4d908f2 commit f1a038c

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

test-wheel.bash

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,21 @@ cleanup_background_jobs() {
116116
}
117117

118118
cleanup_virtualenv() {
119-
if [[ "$cleanup" == "true" ]]; then
120-
echo "→ Removing $venv"
121-
rm -rf "$venv"
119+
if [[ "$cleanup" != "true" ]]; then
120+
return 0
121+
fi
122+
123+
if [[ "$is_windows_shell" == true ]]; then
124+
# GitHub's Windows runners clean the workspace after each job anyway.
125+
# Avoid synchronously deleting the temporary venv here: Git-Bash/MSYS can
126+
# spend minutes tearing down a Python tree after the background services
127+
# were killed, which turns integration tests into apparent hangs.
128+
echo "→ Skipping synchronous removal of $venv on Windows"
129+
return 0
122130
fi
131+
132+
echo "→ Removing $venv"
133+
rm -rf "$venv"
123134
}
124135

125136
on_exit() {

0 commit comments

Comments
 (0)