Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix image URL tests and bypass raw.githubusercontent.com
- Use fixed ports (19876, 19877) for test image servers instead of
  OS-assigned port 0, making image URLs in provider requests deterministic
- Add raw.githubusercontent.com to no_proxy list so image fetches
  bypass the provider-proxy (they're not provider API calls)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • Loading branch information
AntoineToussaint and claude committed Apr 9, 2026
commit 39952f2721ed0600d4a48c9726cc13eab32f542a
2 changes: 1 addition & 1 deletion crates/tensorzero-core/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ fn build_client(global_outbound_http_timeout: Duration) -> Result<Client, Error>
})
})?
.no_proxy(NoProxy::from_string(
"localhost,0.0.0.0,127.0.0.1,minio,mock-provider-api,gateway,provider-proxy,clickhouse",
"localhost,0.0.0.0,127.0.0.1,minio,mock-provider-api,gateway,provider-proxy,clickhouse,raw.githubusercontent.com",
)),
)
// When running e2e tests, we use `provider-proxy` as an MITM proxy
Expand Down
4 changes: 3 additions & 1 deletion crates/tensorzero-core/tests/e2e/image_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ use crate::providers::common::FERRIS_PNG;

/// Spawn a temporary HTTP server that serves the test image
async fn make_temp_image_server() -> (SocketAddr, tokio::sync::oneshot::Sender<()>) {
let addr = SocketAddr::from(([127, 0, 0, 1], 0));
// Use a fixed port so that image URLs in provider requests are deterministic
// across test runs, enabling provider-proxy cache hits.
let addr = SocketAddr::from(([127, 0, 0, 1], 19876));
let listener = tokio::net::TcpListener::bind(addr)
.await
.unwrap_or_else(|e| panic!("Failed to bind to {addr}: {e}"));
Expand Down
4 changes: 3 additions & 1 deletion crates/tensorzero-core/tests/e2e/providers/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,9 @@ pub async fn test_image_inference_with_provider_s3_compatible(
}

async fn make_temp_image_server() -> (SocketAddr, tokio::sync::oneshot::Sender<()>) {
let addr = SocketAddr::from(([127, 0, 0, 1], 0));
// Use a fixed port so that image URLs in provider requests are deterministic
// across test runs, enabling provider-proxy cache hits.
let addr = SocketAddr::from(([127, 0, 0, 1], 19877));
let listener = tokio::net::TcpListener::bind(addr)
.await
.unwrap_or_else(|e| panic!("Failed to bind to {addr}: {e}"));
Expand Down
Loading