Skip to content

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

chore(scripts): isolate test Compose project and guard against port conflicts

Steven Enamakeldd0d3b016c36
diff --git a/scripts/test-memory-cortexdb-live.sh b/scripts/test-memory-cortexdb-live.sh
index 6f7c785289..93de3e3b46 100755
--- a/scripts/test-memory-cortexdb-live.sh
+++ b/scripts/test-memory-cortexdb-live.sh
@@ -19,8 +19,8 @@ set -euo pipefail
repo="$(cd "$(dirname "$0")/.." && pwd)"
harness="$repo/vendor/tinymemory/integration/cortexdb/docker-compose.yml"
-compose=(docker compose --project-name openhuman-memory-cortexdb -f "$harness")
-port="${CORTEXDB_PORT:-3141}"
+compose=(docker compose --project-name openhuman-memory-cortexdb-test -f "$harness")
+port="${CORTEXDB_PORT:-3142}"
url="http://127.0.0.1:$port"
export CORTEXDB_PORT="$port"
@@ -29,6 +29,14 @@ if [ ! -f "$harness" ]; then
exit 1
fi
+# A test run owns its own Compose project and tears it down with its volumes,
+# so it must never share one with a server someone is using. Refuse a port
+# that already answers rather than reuse or replace what is there.
+if curl --silent --max-time 2 "$url/v1/admin/health" >/dev/null 2>&1; then
+ echo "something already serves $url; pick a free CORTEXDB_PORT" >&2
+ exit 1
+fi
+
cleanup() {
result=$?
if [ "$result" -ne 0 ]; then