Adds deadline & expands comment

pull/21271/head
Lidi Zheng 5 years ago
parent ed054d03a1
commit 028938f0cc
  1. 15
      tools/internal_ci/helper_scripts/install_python38.ps1

@ -33,9 +33,20 @@ function Install-Python {
throw "The Python installation exited with error!"
}
# Validates Python
# Validates Python binary
# NOTE(lidiz) Even if the install command finishes in the script, that
# doesn't mean the Python installation is finished. If using "ps" to check
# for running processes, you might see ongoing installers at this point.
# So, we needs this "hack" to reliably validate that the Python binary is
# functioning properly.
$ValidationStartTime = Get-Date
$EarlyExitDDL = $ValidationStartTime.addminutes(5)
$PythonBinary = "$PythonInstallPath\python.exe"
while ($true) {
While ($True) {
$CurrentTime = Get-Date
if ($CurrentTime -ge $EarlyExitDDL) {
throw "Invalid Python installation! Timeout!"
}
& $PythonBinary -c 'print(42)'
if ($?) {
Write-Host "Python binary works properly."

Loading…
Cancel
Save