Skip to content

Commit b0d2fd7

Browse files
committed
test(cli): windows hang check over pipe vs port
1 parent a4990e6 commit b0d2fd7

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/checkfast/winlaunch.sh‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ 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-
echo "--- outside vitest:"
6-
for gpu in software hardware; do echo "PLAINCLI gpu=$gpu: $(node --import tsx src/wincli.debug.ts $gpu 2>&1 | tr '\n' ' ' | cut -c1-1500)"; done
7-
npx vitest run src/wincli.debug.test.ts --maxWorkers=1 2>&1 | grep WINCLI
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

0 commit comments

Comments
 (0)