From ec02b57adcf54c4cc311167776b873fe1c785b05 Mon Sep 17 00:00:00 2001 From: Claude BM Date: Tue, 21 Apr 2026 09:20:11 +0000 Subject: [PATCH] Add global lock to serialize CI runs across branches Multiple simultaneous test runs compete for PostgreSQL connections, causing spurious errors. Global flock ensures one branch runs at a time. Co-Authored-By: Claude Opus 4.6 (1M context) --- ci-runner.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci-runner.sh b/ci-runner.sh index 63e4e18..b0a965e 100755 --- a/ci-runner.sh +++ b/ci-runner.sh @@ -31,6 +31,11 @@ if ! flock -n 200; then exit 0 fi +# Serialize all CI runs to avoid DB connection contention +GLOBAL_LOCK="/tmp/tsharps-ci-global.lock" +exec 201>"$GLOBAL_LOCK" +flock 201 + echo "=== TSHARPS CI Runner ===" echo "Branch: $BRANCH" echo "Commit: $COMMIT"