Skip to content

Commit 3750c6f

Browse files
committed
ci fixes
1 parent 18a29ee commit 3750c6f

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ jobs:
136136
curl --retry 60 --retry-delay 5 --retry-all-errors -ksf https://127.0.0.1:443/api/v1/health/live
137137
echo "Waiting for frontend..."
138138
curl --retry 60 --retry-delay 5 --retry-all-errors -ksf https://127.0.0.1:5001/
139+
echo "Testing frontend->backend proxy..."
140+
docker exec frontend curl -ksf https://backend:443/api/v1/health/live || echo "WARNING: Frontend cannot reach backend!"
141+
echo "Testing auth endpoint via proxy..."
142+
curl -ksf https://127.0.0.1:5001/api/v1/auth/verify-token || echo "WARNING: Auth endpoint returned error (expected without cookies)"
139143
echo "Services ready!"
140144
141145
- name: Run E2E tests

frontend/playwright.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ export default defineConfig({
44
testDir: './e2e',
55
fullyParallel: true,
66
forbidOnly: !!process.env.CI,
7-
retries: process.env.CI ? 1 : 0, // Reduced: 1 retry is enough to catch flakes
8-
workers: process.env.CI ? 2 : undefined, // Increased: tests are independent
9-
timeout: 30000, // 30s is plenty for page operations
7+
retries: process.env.CI ? 1 : 0,
8+
workers: process.env.CI ? 2 : undefined,
9+
timeout: 10000, // 10s max per test
1010
expect: {
11-
timeout: 5000, // 5s for element expectations
11+
timeout: 3000, // 3s for assertions
1212
},
1313
reporter: process.env.CI ? [['html'], ['github']] : 'html',
1414
use: {

frontend/rollup.config.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,21 @@ function startServer() {
6262
proxyRes.pipe(res, { end: true });
6363
});
6464

65+
// Socket timeout prevents hanging when backend is unreachable
66+
proxyReq.on('socket', (socket) => {
67+
socket.setTimeout(2000);
68+
socket.on('timeout', () => {
69+
console.error('Proxy socket timeout - backend unreachable');
70+
proxyReq.destroy(new Error('Socket timeout'));
71+
});
72+
});
73+
6574
proxyReq.on('error', (e) => {
6675
console.error(`Proxy request error: ${e.message}`);
67-
res.writeHead(502);
68-
res.end('Bad Gateway');
76+
if (!res.headersSent) {
77+
res.writeHead(502);
78+
res.end('Bad Gateway');
79+
}
6980
});
7081

7182
req.pipe(proxyReq, { end: true });

0 commit comments

Comments
 (0)