diff options
| author | bors <bors@rust-lang.org> | 2025-08-18 23:20:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-08-18 23:20:09 +0000 |
| commit | b96868fa2ef174b0a5aeb3bf041b3a5b517f11f8 (patch) | |
| tree | 7071f9af655ecb47d3138ad5d84ca723a366c377 | |
| parent | 9eb4a2652031ed5ba97c29ef21c79db1645f7883 (diff) | |
| parent | 4f7248207c59075a0aa203b1b6e9bfb67ef93d52 (diff) | |
| download | rust-b96868fa2ef174b0a5aeb3bf041b3a5b517f11f8.tar.gz rust-b96868fa2ef174b0a5aeb3bf041b3a5b517f11f8.zip | |
Auto merge of #145559 - marcoieni:free-disk-timeout, r=Kobzol
ci: add timeout to windows disk cleanup wait
| -rw-r--r-- | src/ci/scripts/free-disk-space-windows-wait.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/ci/scripts/free-disk-space-windows-wait.py b/src/ci/scripts/free-disk-space-windows-wait.py index b8612bb71c2..d510781d534 100644 --- a/src/ci/scripts/free-disk-space-windows-wait.py +++ b/src/ci/scripts/free-disk-space-windows-wait.py @@ -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() |
