Skip to content

Commit 1e48a0b

Browse files
committed
test(e2e): add strace and browser launch diagnostics
1 parent add3197 commit 1e48a0b

2 files changed

Lines changed: 48 additions & 21 deletions

File tree

.github/workflows/test-e2e.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,39 @@ jobs:
124124
sleep 1
125125
done
126126
127-
# Test 1: Try without globalSetup to isolate hang (no pipes)
128-
echo "[$(date -Iseconds)] Running playwright WITHOUT globalSetup..."
129-
timeout 60 env SKIP_GLOBAL_SETUP=1 CI=true ./node_modules/.bin/playwright test -c ./test/e2e/playwright.config.js --reporter=list || echo "Test 1 exited: $?"
130-
131-
# Test 2: Full test run
132-
echo "[$(date -Iseconds)] Running full playwright test..."
133-
CI=true ./node_modules/.bin/playwright test -c ./test/e2e/playwright.config.js --reporter=list
127+
# Debug: check what playwright binary does
128+
echo "[$(date -Iseconds)] Node and Playwright info:"
129+
node --version
130+
./node_modules/.bin/playwright --version
131+
132+
# Debug: try launching browser directly
133+
echo "[$(date -Iseconds)] Testing browser launch..."
134+
timeout 30 node -e "
135+
const { chromium } = require('playwright');
136+
(async () => {
137+
console.log('Launching browser...');
138+
const browser = await chromium.launch();
139+
console.log('Browser launched, closing...');
140+
await browser.close();
141+
console.log('Done');
142+
})();
143+
" || echo "Browser launch test exited: $?"
144+
145+
# Full test run with strace to see what it's waiting on
146+
echo "[$(date -Iseconds)] Running full playwright test with strace..."
147+
timeout 120 strace -f -e trace=read,write,poll,select,epoll_wait -o /tmp/strace.log \
148+
./node_modules/.bin/playwright test -c ./test/e2e/playwright.config.js --reporter=list &
149+
PW_PID=$!
150+
151+
# Wait a bit then show what strace captured
152+
sleep 30
153+
echo "[$(date -Iseconds)] strace output (last 100 lines):"
154+
tail -100 /tmp/strace.log || true
155+
156+
# Wait for playwright to finish or timeout
157+
wait $PW_PID
134158
TEST_EXIT=$?
159+
echo "[$(date -Iseconds)] Playwright exited with: $TEST_EXIT"
135160
136161
# Cleanup
137162
echo "[$(date -Iseconds)] Stopping server..."

test/e2e/playwright.config.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,22 @@ const config = {
3838
globalSetup: process.env.SKIP_GLOBAL_SETUP ? undefined : './setup/global-setup.js',
3939
globalTeardown: process.env.SKIP_GLOBAL_SETUP ? undefined : './setup/global-teardown.js',
4040
// On CI, we start the server externally, so skip webServer entirely
41-
webServer: process.env.CI ? [] : [
42-
{
43-
command: 'node ./setup/serve-build.js',
44-
timeout: 30 * 1000,
45-
url: `http://127.0.0.1:${webuiPort}/`,
46-
reuseExistingServer: false,
47-
stdout: 'inherit',
48-
stderr: 'inherit',
49-
env: {
50-
...process.env,
51-
WEBUI_PORT: String(webuiPort)
52-
}
53-
}
54-
],
41+
webServer: process.env.CI
42+
? []
43+
: [
44+
{
45+
command: 'node ./setup/serve-build.js',
46+
timeout: 30 * 1000,
47+
url: `http://127.0.0.1:${webuiPort}/`,
48+
reuseExistingServer: false,
49+
stdout: 'inherit',
50+
stderr: 'inherit',
51+
env: {
52+
...process.env,
53+
WEBUI_PORT: String(webuiPort)
54+
}
55+
}
56+
],
5557
collectCoverage: true,
5658
coverageConfig: {
5759
include: [

0 commit comments

Comments
 (0)