diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-05 02:33:27 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-05 02:33:27 +0300 |
| commit | 697290942820f8a0227440a1ca384173f8ccc5e8 (patch) | |
| tree | 6ac6dead32a81675b2622b0e391bbfeb3b612846 | |
| parent | c78349f422139577f8d7bf5e07f84dcec5a48456 (diff) | |
test: wait for windows smoke pane output
| -rw-r--r-- | scripts/windows_smoke_conpty_path.ps1 | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/windows_smoke_conpty_path.ps1 b/scripts/windows_smoke_conpty_path.ps1 index d3fceb3f..41f637fc 100644 --- a/scripts/windows_smoke_conpty_path.ps1 +++ b/scripts/windows_smoke_conpty_path.ps1 @@ -85,12 +85,17 @@ try { } Invoke-Checked $exe @("agent", "start", "smoke", "--", $env:ComSpec, "/K", "dir") - Start-Sleep -Seconds 2 - $read = & $exe agent read smoke --source recent --lines 40 --format text - if ($LASTEXITCODE -ne 0) { - throw "command failed with exit code $LASTEXITCODE`: $exe agent read smoke" - } - $text = $read -join "`n" + $text = "" + $deadline = (Get-Date).AddSeconds(15) + do { + Start-Sleep -Milliseconds 500 + $read = & $exe agent read smoke --source recent --lines 40 --format text 2>&1 + $text = $read -join "`n" + if ($LASTEXITCODE -eq 0 -and $text -match "File\(s\)" -and $text -match "Dir\(s\)") { + break + } + } while ((Get-Date) -lt $deadline) + if ($text -notmatch "File\(s\)" -or $text -notmatch "Dir\(s\)") { throw "pane read did not include cmd.exe directory output: $text" } |
