From 697290942820f8a0227440a1ca384173f8ccc5e8 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 5 Jul 2026 02:33:27 +0300 Subject: test: wait for windows smoke pane output --- scripts/windows_smoke_conpty_path.ps1 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'scripts/windows_smoke_conpty_path.ps1') 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" } -- cgit v1.2.3