Skip to content

Commit 86b6f4d

Browse files
committed
test(cli): count leftover chrome after windows warm tests
1 parent b0d2fd7 commit 86b6f4d

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

‎.github/checkfast/winlaunch.sh‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ set -u
22
node --import tsx packages/cli/scripts/prepare-process-test-browser.mjs
33
export HYPERFRAMES_BROWSER_PATH=$(grep HYPERFRAMES_BROWSER_PATH "$GITHUB_ENV" | tail -1 | cut -d= -f2-)
44
cd packages/cli
5-
FX=$RUNNER_TEMP/hang; mkdir -p $FX/compositions
6-
printf '%s' '<!doctype html><html><body><div data-composition-id="main" data-width="320" data-height="180" data-duration="1"><div data-composition-id="hang" data-composition-src="compositions/hang.html" data-start="0" data-duration="1"></div></div><script>window.__timelines={main:{duration:()=>1,seek:()=>{},pause:()=>{}}};</script></body></html>' > $FX/index.html
7-
printf '%s' '<template id="hang"><div data-composition-id="hang"><div id="box" style="width:1px;height:1px"></div><script>const el=document.getElementById("box");while(el.offsetWidth<2){el.style.height="1px";}</script></div></template>' > $FX/compositions/hang.html
8-
hang() { s=$(node -e 'console.log(Date.now())'); timeout 240 node --import tsx src/cli.ts check $FX --json --samples=1 --no-browser-gpu > $RUNNER_TEMP/h.out 2>$RUNNER_TEMP/h.err; c=$?; e=$(node -e 'console.log(Date.now())'); echo "HANGCHECK $1 exit=$c ms=$((e-s)) $(grep -o 'did not finish[^"]*' $RUNNER_TEMP/h.out | head -1)"; }
9-
t() { npx vitest run src/utils/checkDeadline.process.test.ts --maxWorkers=1 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep -E "✓|×|Tests " | sed "s/^/DEADLINE $1 /"; }
10-
hang pipe; t pipe
11-
sed -i 's/puppeteer.launch({ ...options, pipe: true,/puppeteer.launch({ ...options, pipe: process.platform !== "win32",/' src/browser/launch.ts
12-
grep -c 'pipe: process.platform !== "win32"' src/browser/launch.ts
13-
hang port; t port
5+
chromes() { echo "CHROME $1: $(tasklist //FI "IMAGENAME eq chrome-headless-shell.exe" //NH 2>/dev/null | grep -ci chrome-headless) headless-shell procs; $(powershell -NoProfile -Command "(Get-Process chrome-headless-shell -ErrorAction SilentlyContinue | Measure-Object -Property CPU -Sum).Sum") cpu-s"; }
6+
chromes before
7+
npx vitest run src/warmCheck.process.test.ts --maxWorkers=1 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep -E "✓|×|Tests " | sed 's/^/WARM /'
8+
chromes after-warm; sleep 20; chromes after-warm+20s
9+
npx vitest run src/warmCheck.process.test.ts src/utils/checkDeadline.process.test.ts --maxWorkers=2 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep -E "✓|×|Tests " | sed 's/^/BOTH /'
10+
chromes after-both

0 commit comments

Comments
 (0)