Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(e2e-web-ports): add test for core port mismatch rejection

Steven Enamakela3bfc7f46bf9
diff --git a/scripts/__tests__/e2e-web-ports.test.mjs b/scripts/__tests__/e2e-web-ports.test.mjs
index ff91d7a037..aec69bacc2 100644
--- a/scripts/__tests__/e2e-web-ports.test.mjs
+++ b/scripts/__tests__/e2e-web-ports.test.mjs
@@ -401,6 +401,24 @@ test("a session on a different base than the build is refused", async () => {
}
});
+test("a session with a different core port than the build is refused", async () => {
+ const tree = makeTree();
+ try {
+ const base = await freeBase();
+ markBundle(tree, { mockPort: base, corePort: base + 1 });
+
+ const res = run(tree, "e2e-web-session.sh", {
+ E2E_PORT_BASE: String(base),
+ OPENHUMAN_CORE_PORT: String(base + 9),
+ });
+
+ assert.equal(res.status, 1, res.output);
+ assert.match(res.output, /built for OPENHUMAN_CORE_PORT=/);
+ } finally {
+ tree.cleanup();
+ }
+});
+
test("a wildcard listener on one of the ports is still detected", async () => {
// A bind probe would call this port free: with SO_REUSEADDR a 127.0.0.1 bind
// coexists with an existing 0.0.0.0 listener on macOS and BSD, while that