From 95937c6d0a92bb3eb4aeefb31bb7c730bce1f962 Mon Sep 17 00:00:00 2001 From: Drew Cain Date: Sat, 20 Dec 2025 10:27:26 -0600 Subject: [PATCH] fix: make test-int-postgres compatible with macOS Use gtimeout (Homebrew) or timeout (Linux), falling back to running without timeout if neither is available. This fixes 'command not found' errors on macOS which doesn't have GNU timeout by default. --- justfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 44241869..0665005b 100644 --- a/justfile +++ b/justfile @@ -51,7 +51,16 @@ test-int-sqlite: # Note: Uses timeout due to FastMCP Client + asyncpg cleanup hang (tests pass, process hangs on exit) # See: https://github.com/jlowin/fastmcp/issues/1311 test-int-postgres: - timeout --signal=KILL 600 bash -c 'BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov test-int' || test $? -eq 137 + #!/usr/bin/env bash + set -euo pipefail + # Use gtimeout (macOS/Homebrew) or timeout (Linux) + TIMEOUT_CMD=$(command -v gtimeout || command -v timeout || echo "") + if [[ -n "$TIMEOUT_CMD" ]]; then + $TIMEOUT_CMD --signal=KILL 600 bash -c 'BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov test-int' || test $? -eq 137 + else + echo "⚠️ No timeout command found, running without timeout..." + BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov test-int + fi # Reset Postgres test database (drops and recreates schema) # Useful when Alembic migration state gets out of sync during development