diff --git a/packages/safe-chain/src/registryProxy/plainHttpProxy.js b/packages/safe-chain/src/registryProxy/plainHttpProxy.js index 214ad0f..2cd5f24 100644 --- a/packages/safe-chain/src/registryProxy/plainHttpProxy.js +++ b/packages/safe-chain/src/registryProxy/plainHttpProxy.js @@ -1,10 +1,8 @@ import * as http from "http"; import * as https from "https"; -// oxlint-disable no-console - just for testing, remove afterwards export function handleHttpProxyRequest(req, res) { const url = new URL(req.url); - console.log(`Proxying request to: ${req.url}`); let protocol; if (url.protocol === "http:") { @@ -25,27 +23,12 @@ export function handleHttpProxyRequest(req, res) { res.writeHead(proxyRes.statusCode, proxyRes.headers); proxyRes.pipe(res); - proxyRes.on("error", (err) => { - console.log("Error in proxy response stream:", err); - // Stream error while piping response - // Response headers already sent, can't send error status - }); - proxyRes.on("close", () => { - console.log("Proxy response stream closed"); // Clean up if the proxy response stream closes if (!res.writableEnded) { res.end(); } }); - - proxyRes.on("end", () => { - console.log("Proxy response stream ended"); - // End of proxy response - if (!res.writableEnded) { - res.end(); - } - }); } ) .on("error", (err) => { @@ -54,21 +37,18 @@ export function handleHttpProxyRequest(req, res) { }); req.on("error", () => { - console.log("Error in client request stream"); // Client request stream error // Abort the proxy request proxyRequest.destroy(); }); res.on("error", () => { - console.log("Error in client response stream"); // Client response stream error (client disconnected) // Clean up proxy streams proxyRequest.destroy(); }); res.on("close", () => { - console.log("Client response stream closed"); // Client disconnected // Abort the proxy request to avoid unnecessary work if (!res.writableEnded) { diff --git a/test/e2e/DockerTestContainer.js b/test/e2e/DockerTestContainer.js index 45b66d0..ec1af3c 100644 --- a/test/e2e/DockerTestContainer.js +++ b/test/e2e/DockerTestContainer.js @@ -120,7 +120,7 @@ export class DockerTestContainer { console.log("Command timeout reached"); resolve({ allData, output: parseShellOutput(allData), command }); ptyProcess.removeListener("data", handleInput); - }, 20000); + }, 15000); function handleInput(data) { allData.push(data); diff --git a/test/e2e/package.json b/test/e2e/package.json index b34fd0b..9217808 100644 --- a/test/e2e/package.json +++ b/test/e2e/package.json @@ -4,7 +4,7 @@ "version": "1.0.0", "description": "End-to-end tests for the Aikido Safe Chain", "scripts": { - "test": "node --test --test-concurrency=1 **/safe-chain-proxy.e2e.spec.js" + "test": "node --test --test-concurrency=1 **/*.spec.js" }, "keywords": [], "author": "Aikido Security", diff --git a/test/e2e/safe-chain-proxy.e2e.spec.js b/test/e2e/safe-chain-proxy.e2e.spec.js index 22a7038..6abbb0f 100644 --- a/test/e2e/safe-chain-proxy.e2e.spec.js +++ b/test/e2e/safe-chain-proxy.e2e.spec.js @@ -14,8 +14,8 @@ describe("E2E: Safe chain proxy", () => { container = new DockerTestContainer(); await container.start(); - // const installationShell = await container.openShell("zsh"); - // await installationShell.runCommand("safe-chain setup"); + const installationShell = await container.openShell("zsh"); + await installationShell.runCommand("safe-chain setup"); }); afterEach(async () => {