diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4fc508e..66d3cce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ env: jobs: deploy: runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 35 permissions: contents: read id-token: write diff --git a/scripts/wait_for_ib_gateway_ready.sh b/scripts/wait_for_ib_gateway_ready.sh index 49840f4..cc363f1 100644 --- a/scripts/wait_for_ib_gateway_ready.sh +++ b/scripts/wait_for_ib_gateway_ready.sh @@ -32,6 +32,7 @@ check_api_handshake() { import os import socket import struct +import sys import time @@ -51,16 +52,24 @@ except ImportError: if IB is not None: ib = IB() try: - ib.connect(host, port, clientId=client_id, timeout=timeout_seconds) - accounts = ib.managedAccounts() - if not accounts: - raise RuntimeError("IB API healthcheck did not receive managed accounts") - print( - "IB API ib_insync healthcheck ready: " - f"server_version={ib.client.serverVersion()} " - f"client_id={client_id} " - f"accounts={','.join(accounts)}" - ) + try: + ib.connect(host, port, clientId=client_id, timeout=timeout_seconds) + accounts = ib.managedAccounts() + if not accounts: + raise RuntimeError("IB API healthcheck did not receive managed accounts") + print( + "IB API ib_insync healthcheck ready: " + f"server_version={ib.client.serverVersion()} " + f"client_id={client_id} " + f"accounts={','.join(accounts)}" + ) + except Exception as exc: + print( + "IB API ib_insync healthcheck not ready: " + f"{type(exc).__name__}: {exc}", + file=sys.stderr, + ) + raise SystemExit(1) finally: if ib.isConnected(): ib.disconnect() diff --git a/tests/test_workflow_shared_config.sh b/tests/test_workflow_shared_config.sh index 2541498..5870859 100644 --- a/tests/test_workflow_shared_config.sh +++ b/tests/test_workflow_shared_config.sh @@ -8,7 +8,7 @@ grep -Fq 'GCP_PROJECT_ID: interactivebrokersquant' "$workflow_file" grep -Fq 'providers/github-ibkr-gateway-main' "$workflow_file" grep -Fq 'ibkr-gateway-deploy@interactivebrokersquant.iam.gserviceaccount.com' "$workflow_file" grep -Fq 'id-token: write' "$workflow_file" -grep -Fq 'timeout-minutes: 20' "$workflow_file" +grep -Fq 'timeout-minutes: 35' "$workflow_file" grep -Fq 'sync_github_secrets_to_secret_manager:' "$workflow_file" grep -Fq 'deploy_mode:' "$workflow_file" grep -Fq 'workload_identity_provider: ${{ env.GCP_WORKLOAD_IDENTITY_PROVIDER }}' "$workflow_file"