mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
Merge branch 'backport/master-to-release-6.1-20260701' into 'release/v6.1'
fix(ci): Tolerate w32time already running on Windows CI VMs See merge request espressif/esp-idf!50264
This commit is contained in:
+21
-6
@@ -314,12 +314,27 @@ variables:
|
|||||||
- pip install --upgrade --pre @extraIndex esptool -c "$env:USERPROFILE\.espressif\$env:CI_PYTHON_CONSTRAINT_FILE"
|
- pip install --upgrade --pre @extraIndex esptool -c "$env:USERPROFILE\.espressif\$env:CI_PYTHON_CONSTRAINT_FILE"
|
||||||
- $env:PYTHONPATH = "$env:PYTHONPATH;$env:IDF_PATH\tools;$env:IDF_PATH\tools\esp_app_trace;$env:IDF_PATH\components\partition_table;$env:IDF_PATH\tools\ci\python_packages"
|
- $env:PYTHONPATH = "$env:PYTHONPATH;$env:IDF_PATH\tools;$env:IDF_PATH\tools\esp_app_trace;$env:IDF_PATH\components\partition_table;$env:IDF_PATH\tools\ci\python_packages"
|
||||||
- python "${SUBMODULE_FETCH_TOOL}" -s "${SUBMODULES_TO_FETCH}"
|
- python "${SUBMODULE_FETCH_TOOL}" -s "${SUBMODULES_TO_FETCH}"
|
||||||
# The time in VM may not be synced, since it's built a long time ago, so we need to sync time
|
# Sync VM clock. net start/stop exit 2 when the service is already in that state; do not fail CI.
|
||||||
- net start w32time
|
- |
|
||||||
- w32tm /config /manualpeerlist:"time.google.com,0x9 pool.ntp.org,0x9" /syncfromflags:manual /reliable:yes /update
|
function Invoke-NetService($Action, $Name) {
|
||||||
- net stop w32time
|
$output = net $Action $Name 2>&1
|
||||||
- net start w32time
|
if ($LASTEXITCODE -eq 2) {
|
||||||
- w32tm /resync
|
Write-Host "net $Action $Name already in requested state: $output"
|
||||||
|
$global:LASTEXITCODE = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-Host $output
|
||||||
|
exit $LASTEXITCODE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Invoke-NetService start w32time
|
||||||
|
w32tm /config /manualpeerlist:"time.google.com,0x9 pool.ntp.org,0x9" /syncfromflags:manual /reliable:yes /update
|
||||||
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||||
|
Invoke-NetService stop w32time
|
||||||
|
Invoke-NetService start w32time
|
||||||
|
w32tm /resync
|
||||||
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||||
after_script: []
|
after_script: []
|
||||||
|
|
||||||
#############
|
#############
|
||||||
|
|||||||
Reference in New Issue
Block a user