debug multi-threaded GH actions tests

This commit is contained in:
Lucas Gelfond 2024-12-23 17:35:20 -08:00
parent b237a87bd2
commit 58fccc8548

View File

@ -128,25 +128,39 @@ jobs:
-a no-sandbox \ -a no-sandbox \
-f http://localhost:3000/tests/ffmpeg-st.test.html 2>&1 | tee st-test.log -f http://localhost:3000/tests/ffmpeg-st.test.html 2>&1 | tee st-test.log
# Run multi-threaded tests with additional SharedArrayBuffer flags # Run multi-threaded tests
echo "Running multi-threaded tests..." echo "Running multi-threaded tests..."
CHROME_FLAGS="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation --cross-origin-isolated" # Create a test script to verify browser environment
cat << EOF > verify-browser.html
# Debug SharedArrayBuffer availability <!DOCTYPE html>
echo "Testing SharedArrayBuffer availability..." <html>
cat << EOF > debug-sab.js <head>
console.log('SharedArrayBuffer available:', typeof SharedArrayBuffer !== 'undefined'); <title>Browser Environment Test</title>
console.log('crossOriginIsolated:', window.crossOriginIsolated); </head>
<body>
<script>
console.log('SharedArrayBuffer available:', typeof SharedArrayBuffer !== 'undefined');
console.log('crossOriginIsolated:', window.crossOriginIsolated);
</script>
</body>
</html>
EOF EOF
node debug-sab.js
# Run the verification in Chrome
echo "Verifying browser environment..."
npx mocha-headless-chrome \ npx mocha-headless-chrome \
--args="$CHROME_FLAGS" \ --args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
-a no-sandbox \
-f http://localhost:3000/verify-browser.html
# Run MT tests with verified configuration
npx mocha-headless-chrome \
--args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
-a no-sandbox \ -a no-sandbox \
-f http://localhost:3000/tests/ffmpeg-core-mt.test.html 2>&1 | tee mt-core-test.log -f http://localhost:3000/tests/ffmpeg-core-mt.test.html 2>&1 | tee mt-core-test.log
npx mocha-headless-chrome \ npx mocha-headless-chrome \
--args="$CHROME_FLAGS" \ --args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
-a no-sandbox \ -a no-sandbox \
-f http://localhost:3000/tests/ffmpeg-mt.test.html 2>&1 | tee mt-test.log -f http://localhost:3000/tests/ffmpeg-mt.test.html 2>&1 | tee mt-test.log