ci(temporal): cache test-server binary to fix temporal.download 429 flakes#382
Merged
Abhijeet Prasad (AbhiPrasad) merged 2 commits intomainfrom May 1, 2026
Merged
Conversation
The temporal_env fixture calls WorkflowEnvironment.start_time_skipping(), which downloads the Java test-server binary from temporal.download on every run. GitHub Actions runners regularly hit 429 there, flaking the temporal nox shards. Cache the binary across CI runs and pass it via test_server_existing_path. The fixture honors a new BRAINTRUST_TEMPORAL_TEST_SERVER_PATH env var; when unset (the local default), the SDK's normal download behavior is preserved. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the manually-pinned test-server version + curl/extract bash with the temporalio SDK's native download_dest_dir caching. The SDK keys cached binaries by Python SDK version (e.g. temporal-test-server-sdk-python-1.27.0) and reuses them on subsequent start_time_skipping calls, so CI just needs to persist the directory across runs and let each temporalio matrix entry populate the binary it wants. Cache key now hashes py/pyproject.toml so any matrix bump invalidates cleanly. Verified locally: cold cache setup ~1.4s, warm cache setup ~0.1s with HTTPS proxy black-holed (no re-download). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Abhijeet Prasad (AbhiPrasad)
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RuntimeError: Failed starting test server: HTTP status client error (429 Too Many Requests)when fetchingtemporal-test-server_*.tar.gzfromtemporal.download. Every CI run downloads ~80 MB per shard, and the CDN rate-limits GitHub Actions IP space.temporal-test-server-sdk-python-<version>) and reuses them whendownload_dest_diris set, so this is just plumbing — no manual version pin or curl/extract logic.BRAINTRUST_TEMPORAL_TEST_SERVER_DIRis unset (the local default), the SDK falls back to its built-in temp-dir download behavior.Changes
.github/workflows/checks.yaml: on Linux runners only,actions/cache@v5.0.5restores~/.cache/braintrust/temporal-test-server. Cache key includeshashFiles('py/pyproject.toml')so any matrix bump invalidates cleanly, with arestore-keys:prefix fallback so most cache restores still hit. A small step exportsBRAINTRUST_TEMPORAL_TEST_SERVER_DIRfor the nox shard.py/src/braintrust/integrations/temporal/test_temporal.py: thetemporal_envfixture honorsBRAINTRUST_TEMPORAL_TEST_SERVER_DIR. When set it passesdownload_dest_dir=...plustest_server_download_ttl=365dto ensure existing binaries are reused. When unset, original behavior unchanged.Windows runners aren't affected — they weren't failing on the original PR and the time-skipping binary path is Linux/macOS-oriented.
Test plan
Verified locally on this devbox:
download_dest_dir): fullnox -s "test_temporal(latest)"passes; binary lands attemporal-test-server-sdk-python-1.27.0. Setup ~1.4s.HTTPS_PROXY=http://127.0.0.1:1black-holed,start_time_skippingstill completes in 0.11s — proves the SDK reuses the cached binary without any network call.nox -s pylintclean.PR-time CI will exercise the cache restore/save cycle across the real shard matrix.
🤖 Generated with Claude Code