From d5eb4e1d2296237177a5b9e7e0b53e905291cfee Mon Sep 17 00:00:00 2001 From: Muhammad Tahir Nawaz Date: Tue, 31 Mar 2026 20:38:11 +0500 Subject: [PATCH 1/2] fix: prebuild server binary to prevent health check timeouts `go run` compiles the Go binary at runtime, which takes ~5 minutes in CI. The health check starts immediately after and uses exponential backoff with a ~5 minute total timeout, so it races against compilation and frequently loses. Splitting into `go build` + execute ensures the server is running before the health check begins. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/integration-tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index fad74aa..870ddf6 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -237,7 +237,8 @@ jobs: echo "$SERVER_ENV" > /tmp/server_extra.env set -a && source /tmp/server_extra.env && set +a fi - nohup go run ${{ inputs.server_cmd }} >> server.log 2>&1 & echo $! > server_pid.txt + go build -o /tmp/server-binary ${{ inputs.server_cmd }} + nohup /tmp/server-binary >> server.log 2>&1 & echo $! > server_pid.txt API_PID=$(cat server_pid.txt) echo "API_PID=$API_PID" >> $GITHUB_ENV echo "Server started with PID: $API_PID" From 5c4a3d53b69db106b753ec67243146aeaf2ed5f9 Mon Sep 17 00:00:00 2001 From: Muhammad Tahir Nawaz Date: Tue, 31 Mar 2026 21:34:21 +0500 Subject: [PATCH 2/2] fix: separate go build step from server start to prevent health check timeouts With Go 1.26, `go run` compilation takes >5 minutes in CI, exceeding the health check timeout window (315s). Split into a dedicated build step followed by running the pre-built binary, so compilation time is isolated and the server starts instantly before the health check. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/integration-tests.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 870ddf6..98c8c78 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -228,7 +228,12 @@ jobs: -d "${{ env.DB_NAME }}" \ -c 'SELECT NOW()' - # --- Start Go server --- + # --- Build and start Go server --- + - name: Build Go server + run: go build -o /tmp/server-binary ${{ inputs.server_cmd }} + env: + GOPRIVATE: github.com/wanaware + - name: Start Go server run: | chmod +x ${{ inputs.wait_for_it_path }} @@ -237,7 +242,6 @@ jobs: echo "$SERVER_ENV" > /tmp/server_extra.env set -a && source /tmp/server_extra.env && set +a fi - go build -o /tmp/server-binary ${{ inputs.server_cmd }} nohup /tmp/server-binary >> server.log 2>&1 & echo $! > server_pid.txt API_PID=$(cat server_pid.txt) echo "API_PID=$API_PID" >> $GITHUB_ENV