Skip to content

Commit d45a060

Browse files
committed
debug(e2e): add logging to diagnose warmServer artifact 404
The local e2e server appears to start (health check passes) but returns 404 for artifact files. Added: - stdout/stderr capture from bun server subprocess - spawn error handler - HTTP response status logging in waitForRequestReady
1 parent 1f32fa5 commit d45a060

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

‎Example/e2etest/e2e/globalSetup.ts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,21 @@ function startServer() {
100100
const child = spawn('bun', [serverScript], {
101101
cwd: projectRoot,
102102
detached: true,
103-
stdio: 'ignore',
103+
stdio: ['ignore', 'pipe', 'pipe'],
104104
env: {
105105
...process.env,
106106
E2E_ASSET_PORT: String(LOCAL_UPDATE_PORT),
107107
},
108108
});
109+
child.stdout?.on('data', (data: Buffer) => {
110+
console.log(`[e2e-server] ${data.toString().trim()}`);
111+
});
112+
child.stderr?.on('data', (data: Buffer) => {
113+
console.error(`[e2e-server] ${data.toString().trim()}`);
114+
});
115+
child.on('error', (err) => {
116+
console.error(`[e2e-server] spawn error: ${err}`);
117+
});
109118
child.unref();
110119
fs.writeFileSync(pidFile, String(child.pid));
111120
}
@@ -162,8 +171,9 @@ async function waitForRequestReady(
162171
if (response.ok) {
163172
return;
164173
}
165-
} catch {
166-
// Keep polling until the timeout expires.
174+
console.log(`[warmServer] ${label}: status ${response.status}`);
175+
} catch (err) {
176+
console.log(`[warmServer] ${label}: fetch error: ${err}`);
167177
}
168178

169179
if (Date.now() - start > timeoutMs) {

0 commit comments

Comments
 (0)