Skip to content

Commit 95937c6

Browse files
committed
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.
1 parent 24dc9a2 commit 95937c6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

justfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ test-int-sqlite:
5151
# Note: Uses timeout due to FastMCP Client + asyncpg cleanup hang (tests pass, process hangs on exit)
5252
# See: https://github.com/jlowin/fastmcp/issues/1311
5353
test-int-postgres:
54-
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
54+
#!/usr/bin/env bash
55+
set -euo pipefail
56+
# Use gtimeout (macOS/Homebrew) or timeout (Linux)
57+
TIMEOUT_CMD=$(command -v gtimeout || command -v timeout || echo "")
58+
if [[ -n "$TIMEOUT_CMD" ]]; then
59+
$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
60+
else
61+
echo "⚠️ No timeout command found, running without timeout..."
62+
BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov test-int
63+
fi
5564
5665
# Reset Postgres test database (drops and recreates schema)
5766
# Useful when Alembic migration state gets out of sync during development

0 commit comments

Comments
 (0)