We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9eb4a26 + 4f72482 commit b96868fCopy full SHA for b96868f
src/ci/scripts/free-disk-space-windows-wait.py
@@ -61,12 +61,27 @@ def read_pid_from_file() -> int:
61
) from e
62
63
64
-def main() -> int:
65
- pid = read_pid_from_file()
+def wait_for_process(pid: int):
+ timeout_duration_seconds = 5 * 60
66
+ interval_seconds = 3
67
+ max_attempts = timeout_duration_seconds / interval_seconds
68
+ attempts = 0
69
70
# Poll until process exits
71
while is_process_running(pid):
- time.sleep(3)
72
+ if attempts >= max_attempts:
73
+ print(
74
+ "::warning::Timeout expired while waiting for the disk cleanup process to finish."
75
+ )
76
+ break
77
+ time.sleep(interval_seconds)
78
+ attempts += 1
79
+
80
81
+def main() -> int:
82
+ pid = read_pid_from_file()
83
84
+ wait_for_process(pid)
85
86
print_logs()
87
0 commit comments