litellm/scripts
yuneng-jiang b602209ca6
test(integration): hand every harness server a port from one per-worker block (#46761)
* test(integration): hand every harness server a port from one per-worker block

About 45 places in the integration harness picked a port by binding port 0,
reading the number back, closing the socket and starting a server on that
number later. Another process could take the port in between, which surfaced
as "Address already in use" flakes. Earlier fixes retried around the race in
single call sites without removing it.

tests/integration/_support/ports.py now owns every port the harness picks
ahead of a server. Each pytest process claims a 200-port block between 10000
and 32767 by taking an exclusive flock on a per-block lock file in the system
temp directory, so parallel runs on one machine never share a block and the
lock goes away with the process. The range is above the fixed service ports
and below the Linux and macOS ephemeral ranges. Ports go out in order, are
never reused in a run, skip anything an outside process already holds, and
a process that exhausts its block claims the next free one.

The three _free_port copies, worker_endpoints' port-0 binds,
free_loopback_port, the owned proxy's lost-port-race retry and the owned
Redis retry loop are gone. Tests that restart a server on the same port now
allocate that port up front instead of reading it back from the first
server. TQ012 in scripts/check_test_quality.py rejects a port-0 bind read
back with getsockname anywhere under tests/integration.

* ci(integration): record listening sockets and the ephemeral port range

* Revert "ci(integration): record listening sockets and the ephemeral port range"

This reverts commit d3fafc3da2.
2026-10-15 16:56:40 -07:00
..
adaptive_router_demo fix(security): remove the publicly known master key from the repo (#44718) 2026-10-06 10:55:24 -07:00
health_check fix(security): remove the publicly known master key from the repo (#44718) 2026-10-06 10:55:24 -07:00
lens_assets refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
trace_codegen refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
auto-close-duplicates.test.ts
auto-close-duplicates.ts
benchmark_anthropic_messages_perf.py fix(security): remove the publicly known master key from the repo (#44718) 2026-10-06 10:55:24 -07:00
benchmark_chat_completions_perf.py fix(security): remove the publicly known master key from the repo (#44718) 2026-10-06 10:55:24 -07:00
benchmark_mock.py fix(security): remove the publicly known master key from the repo (#44718) 2026-10-06 10:55:24 -07:00
benchmark_model_response_creator.py
benchmark_ocr_callbacks.py test(rust): assert native serving via the x-litellm-rust response marker (#46531) 2026-10-14 22:31:47 +00:00
benchmark_proxy_vs_provider.py fix(security): remove the publicly known master key from the repo (#44718) 2026-10-06 10:55:24 -07:00
benchmark_streaming_chunk_overhead.py
build_core_distribution.py feat(sdk): build core from an independent packaging manifest (#44340) 2026-10-08 18:40:14 -07:00
check_mcp_operation_boundary.py
check_mcp_sdk_install.py
check_openapi_docs.py ci: gate undocumented POST routes in the proxy OpenAPI document (#45843) 2026-10-10 21:51:00 +00:00
check_schema_compatibility.py perf(ci): isolate and shard integration suites (#44146) 2026-10-10 11:15:19 -07:00
check_test_quality.py test(integration): hand every harness server a port from one per-worker block (#46761) 2026-10-15 16:56:40 -07:00
check_type_discipline.py feat(lint): add LIT015 requiring pydantic models to be frozen (#42348) 2026-10-07 22:18:00 -07:00
classify-issue.test.ts
classify-issue.ts
comment-fixed-issue.test.ts
comment-fixed-issue.ts
create_litellm_branch.ps1
create_litellm_branch.sh
create_team_key_and_submit_guardrail.sh
default_branch.py
eval_compression.py
flag-duplicate-issue.test.ts
flag-duplicate-issue.ts
gate_slot_lock.py ci(lint): gate every rule on its merge-base count and cap Anys at a fixed total (#40193) 2026-10-08 05:39:29 +00:00
generate_trace_types.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
install-cli.sh
install.sh
install_git_hooks.sh
issue-labels.ts
label-issue.test.ts
label-issue.ts
lint_base_counts.py revert(lint-gates): accept an empty base scan again, since zero violations is a legitimate count (#45319) 2026-10-08 08:40:08 +00:00
mock_bedrock_passthrough_target.py
mock_grayswan_timeout_server.py
mutation_report.py
openapi_docs_gate.py ci: gate undocumented POST routes in the proxy OpenAPI document (#45843) 2026-10-10 21:51:00 +00:00
pre_commit_lint.sh ci: render lint, unit and smoke checks as <tier> / <job> with one collector per tier (#45480) 2026-10-09 04:28:41 +00:00
prisma_generate_if_needed.py
quickstart.ps1 feat(docker): stop, start, and uninstall a quickstart install with litellm-gateway (#46486) 2026-10-15 10:08:06 -07:00
quickstart.sh feat(docker): stop, start, and uninstall a quickstart install with litellm-gateway (#46486) 2026-10-15 10:08:06 -07:00
ruff_strict_gate.py ci(lint): gate every rule on its merge-base count and cap Anys at a fixed total (#40193) 2026-10-08 05:39:29 +00:00
seed_request_logs.py
seed_tracing_fixtures.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
sync-issue-labels.test.ts
sync-issue-labels.ts
sync_together_ai_models.py
test_agent_mcp_endpoints.sh
test_guardrails_register_endpoints.sh
test_quality_gate.py ci(lint): gate every rule on its merge-base count and cap Anys at a fixed total (#40193) 2026-10-08 05:39:29 +00:00
test_tool_allowlist_script.py
tpm_headline_test.sh
type_check_gate.py revert(lint-gates): accept an empty base scan again, since zero violations is a legitimate count (#45319) 2026-10-08 08:40:08 +00:00
type_discipline_gate.py ci(lint): gate every rule on its merge-base count and cap Anys at a fixed total (#40193) 2026-10-08 05:39:29 +00:00
verify_adaptive_router.py
with_dashboard_node.sh