Skip to content
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