Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/sync-cloud-run-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1258,9 +1258,11 @@ jobs:
--http-method=POST \
--oidc-service-account-email="${GCP_SCHEDULER_SERVICE_ACCOUNT}" \
--oidc-token-audience="${service_url}" \
--attempt-deadline=120s \
--max-retry-attempts=0 \
--max-retry-duration=0s \
--attempt-deadline=180s \
--max-retry-attempts=3 \
--min-backoff=120s \
--max-backoff=300s \
--max-retry-duration=900s \
--quiet
else
echo "Creating Cloud Scheduler precheck ${precheck_job_name} at ${desired_precheck_schedule}."
Expand All @@ -1273,9 +1275,11 @@ jobs:
--http-method=POST \
--oidc-service-account-email="${GCP_SCHEDULER_SERVICE_ACCOUNT}" \
--oidc-token-audience="${service_url}" \
--attempt-deadline=120s \
--max-retry-attempts=0 \
--max-retry-duration=0s \
--attempt-deadline=180s \
--max-retry-attempts=3 \
--min-backoff=120s \
--max-backoff=300s \
--max-retry-duration=900s \
--quiet
fi
managed_scheduler_jobs=("${job_name}" "${warmup_job_name}" "${precheck_job_name}")
Expand Down
9 changes: 6 additions & 3 deletions tests/test_scheduler_deadline_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ def test_precheck_uses_per_service_scheduler_with_bounded_deadline() -> None:

assert 'precheck_job_name="${cloud_run_service%-service}-precheck-scheduler"' in workflow
assert 'precheck_uri="${service_url}/dry-run"' in workflow
assert workflow.count("--attempt-deadline=120s") == 2
assert workflow.count("--max-retry-attempts=0") == 2
assert workflow.count("--max-retry-duration=0s") == 2
assert workflow.count("--attempt-deadline=180s") == 2
assert workflow.count("--max-retry-attempts=3") == 2
assert workflow.count("--min-backoff=120s") == 2
assert workflow.count("--max-backoff=300s") == 2
assert workflow.count("--max-retry-duration=900s") == 2
assert workflow.count("--max-retry-attempts=0") == 0
assert 'managed_scheduler_jobs=("${job_name}" "${warmup_job_name}" "${precheck_job_name}")' in workflow
assert 'monitor_job_name="interactive-brokers-monitor-dispatcher-scheduler"' not in workflow
assert 'shared_env_pairs+=("IBKR_MONITOR_DISPATCH_TARGETS_JSON=' not in workflow
Expand Down
11 changes: 8 additions & 3 deletions tests/test_sync_cloud_run_env_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,14 @@ grep -Fq 'precheck_job_name="${cloud_run_service%-service}-precheck-scheduler"'
grep -Fq 'precheck_uri="${service_url}/dry-run"' "$workflow_file"
grep -Fq 'gcloud scheduler jobs update http "${precheck_job_name}"' "$workflow_file"
grep -Fq 'gcloud scheduler jobs create http "${precheck_job_name}"' "$workflow_file"
test "$(grep -Fc -- '--attempt-deadline=120s' "$workflow_file")" -eq 2
test "$(grep -Fc -- '--max-retry-attempts=0' "$workflow_file")" -eq 2
test "$(grep -Fc -- '--max-retry-duration=0s' "$workflow_file")" -eq 2
# Precheck may collide with other dry-runs on maxScale=1; retry transient 429s.
# Keep /run without these retries to avoid duplicate live submits.
test "$(grep -Fc -- '--attempt-deadline=180s' "$workflow_file")" -eq 2
test "$(grep -Fc -- '--max-retry-attempts=3' "$workflow_file")" -eq 2
test "$(grep -Fc -- '--min-backoff=120s' "$workflow_file")" -eq 2
test "$(grep -Fc -- '--max-backoff=300s' "$workflow_file")" -eq 2
test "$(grep -Fc -- '--max-retry-duration=900s' "$workflow_file")" -eq 2
test "$(grep -Fc -- '--max-retry-attempts=0' "$workflow_file")" -eq 0
grep -Fq 'managed_scheduler_jobs=("${job_name}" "${warmup_job_name}" "${precheck_job_name}")' "$workflow_file"
grep -Fq 'for managed_job_name in "${managed_scheduler_jobs[@]}"; do' "$workflow_file"
grep -Fq 'gcloud scheduler jobs resume "${managed_job_name}"' "$workflow_file"
Expand Down