Skip to content

Commit f5d0d3b

Browse files
committed
test(cli): probe the download test file hang with live logs
1 parent 363e72a commit f5d0d3b

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

‎.github/workflows/win-download-probe.yml‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
mode: [pair, alone]
17+
shard: [a, b]
1818
steps:
1919
- name: Disable Windows Defender real-time monitoring
2020
shell: pwsh
@@ -38,12 +38,21 @@ jobs:
3838
run: node --import tsx packages/cli/scripts/prepare-process-test-browser.mjs
3939
- name: Probe
4040
shell: pwsh
41-
timeout-minutes: 20
41+
timeout-minutes: 50
4242
working-directory: packages/cli
4343
run: |
44-
$files = if ("${{ matrix.mode }}" -eq "pair") { @("src/cloud/download.test.ts", "src/capture/publicNetwork.integration.test.ts") } else { @("src/cloud/download.test.ts") }
45-
for ($i = 1; $i -le 10; $i++) {
46-
$out = npx vitest run @files --maxWorkers=2 2>&1 | Out-String
47-
$lines = ($out -split "`n") | Where-Object { $_ -match "download.test.ts \(|publicNetwork.integration.test.ts \(|splits a large|streams the whole|Hook timed|Test Files" }
48-
"RUN $i ${{ matrix.mode }}: $($lines -join ' | ')"
44+
for ($i = 1; $i -le 15; $i++) {
45+
$log = "$env:RUNNER_TEMP\\run-$i.log"
46+
$p = Start-Process -FilePath "cmd.exe" -ArgumentList "/c npx vitest run src/cloud/download.test.ts --maxWorkers=2 --reporter=verbose --reporter=hanging-process > `"$log`" 2>&1" -PassThru -NoNewWindow
47+
$done = $p.WaitForExit(180000)
48+
$tail = Get-Content $log | Where-Object { $_ -match "✓|×|Test Files|Tests |hanging|Error|handle|Timeout|close" }
49+
"RUN $i exited=$done"
50+
$tail | ForEach-Object { " $_" }
51+
if (-not $done) {
52+
"HANG run $i, processes:"
53+
Get-CimInstance Win32_Process | Where-Object { $_.Name -match "node|cmd" } | ForEach-Object { " pid=$($_.ProcessId) ppid=$($_.ParentProcessId) $($_.Name) $(([string]$_.CommandLine).Substring(0, [math]::Min(150, ([string]$_.CommandLine).Length)))" }
54+
"FULL LOG run $i:"
55+
Get-Content $log | ForEach-Object { " | $_" }
56+
taskkill /T /F /PID $p.Id | Out-Null
57+
}
4958
}

0 commit comments

Comments
 (0)