@@ -40,29 +40,26 @@ jobs:
4040 New-Item -ItemType Directory -Force -Path "$env:RUNNER_TEMP\p" | Out-Null
4141 cd "$env:RUNNER_TEMP\p"
4242 node "$env:GITHUB_WORKSPACE\packages\cli\bin\hyperframes.mjs" init canary --example blank --non-interactive --skip-skills
43- - name : check piped , repeated (CI unset)
43+ - name : check read to end of pipe , repeated (CI unset)
4444 shell : pwsh
4545 env :
4646 CI : " "
4747 run : |
4848 cd "$env:RUNNER_TEMP\p\canary"
4949 $bin = "$env:GITHUB_WORKSPACE\packages\cli\bin\hyperframes.mjs"
5050 foreach ($i in 1..3) {
51- $o = "$env:RUNNER_TEMP\out$i.txt"; $e = "$env:RUNNER_TEMP\err$i.txt"
5251 $sw = [Diagnostics.Stopwatch]::StartNew()
53- $p = Start-Process node -ArgumentList $bin,"check" -RedirectStandardOutput $o -RedirectStandardError $e -PassThru -NoNewWindow
54- if (-not $p.WaitForExit(150000)) { Write-Host "RUN $i HUNG after 150s"; Stop-Process -Id $p.Id -Force } else { Write-Host "RUN $i exit $($p.ExitCode) in $($sw.Elapsed.TotalSeconds)s" }
55- Write-Host "--- stdout $i"; Get-Content $o -ErrorAction SilentlyContinue | Select -First 30
56- Write-Host "--- stderr $i"; Get-Content $e -ErrorAction SilentlyContinue | Select -First 30
52+ $psi = New-Object Diagnostics.ProcessStartInfo
53+ $psi.FileName = "node"; $psi.Arguments = "`"$bin`" check"
54+ $psi.RedirectStandardOutput = $true; $psi.RedirectStandardError = $true; $psi.RedirectStandardInput = $true
55+ $psi.UseShellExecute = $false
56+ $p = [Diagnostics.Process]::Start($psi)
57+ $outTask = $p.StandardOutput.ReadToEndAsync(); $errTask = $p.StandardError.ReadToEndAsync()
58+ $exited = $p.WaitForExit(120000)
59+ Write-Host "RUN $i exited=$exited code=$($p.ExitCode) at $($sw.Elapsed.TotalSeconds)s"
60+ $eof = $outTask.Wait(60000)
61+ Write-Host "RUN $i stdout EOF reached=$eof at $($sw.Elapsed.TotalSeconds)s"
62+ if ($eof) { Write-Host $outTask.Result }
63+ Get-CimInstance Win32_Process -Filter "Name='node.exe'" | ForEach-Object { Write-Host " lingering node pid $($_.ProcessId): $($_.CommandLine)" }
64+ if (-not $exited) { Stop-Process -Id $p.Id -Force }
5765 }
58- - name : check piped with CI=1
59- if : always()
60- shell : pwsh
61- env :
62- CI : " 1"
63- run : |
64- cd "$env:RUNNER_TEMP\p\canary"
65- $bin = "$env:GITHUB_WORKSPACE\packages\cli\bin\hyperframes.mjs"
66- $p = Start-Process node -ArgumentList $bin,"check" -RedirectStandardOutput "$env:RUNNER_TEMP\o.txt" -RedirectStandardError "$env:RUNNER_TEMP\e.txt" -PassThru -NoNewWindow
67- if (-not $p.WaitForExit(150000)) { Write-Host "CI=1 RUN HUNG"; Stop-Process -Id $p.Id -Force } else { Write-Host "CI=1 exit $($p.ExitCode)" }
68- Get-Content "$env:RUNNER_TEMP\o.txt" | Select -First 20
0 commit comments