Skip to content

ci: add timeout to windows disk cleanup wait #145559

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

Merged
merged 1 commit into from
Aug 19, 2025
Merged
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
21 changes: 18 additions & 3 deletions src/ci/scripts/free-disk-space-windows-wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,27 @@ def read_pid_from_file() -> int:
) from e


def main() -> int:
pid = read_pid_from_file()
def wait_for_process(pid: int):
timeout_duration_seconds = 5 * 60
interval_seconds = 3
max_attempts = timeout_duration_seconds / interval_seconds
attempts = 0

# Poll until process exits
while is_process_running(pid):
time.sleep(3)
if attempts >= max_attempts:
print(
"::warning::Timeout expired while waiting for the disk cleanup process to finish."
)
break
time.sleep(interval_seconds)
attempts += 1


def main() -> int:
pid = read_pid_from_file()

wait_for_process(pid)

print_logs()

Expand Down
Loading