mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
test(integration): record a stack when an owned proxy crashes (#51922)
Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
91fc6c2071
commit
b90ac69841
2 changed files with 14 additions and 0 deletions
|
|
@ -794,6 +794,7 @@ def _proxy_environment(
|
|||
"STORE_MODEL_IN_DB": "True",
|
||||
"PYTHON_DOTENV_DISABLED": "1",
|
||||
**overrides,
|
||||
"PYTHONFAULTHANDLER": "1",
|
||||
"LITELLM_WORKER_STARTUP_HOOKS": ",".join(
|
||||
hook
|
||||
for hook in (
|
||||
|
|
|
|||
|
|
@ -396,6 +396,19 @@ def test_owned_writer_keeps_only_a_reader_paired_with_its_database(
|
|||
assert environment.get("DATABASE_URL_READ_REPLICA") == expected_reader
|
||||
|
||||
|
||||
@pytest.mark.parametrize("inherited", (None, "", "0"))
|
||||
@pytest.mark.parametrize("override", (None, ""))
|
||||
def test_owned_proxies_always_record_fatal_signal_stacks(inherited: str | None, override: str | None) -> None:
|
||||
with httpx.Client(base_url="http://127.0.0.1:1", trust_env=False) as client:
|
||||
environment: Final = _proxy_environment(
|
||||
Gateway(client, "owned-test-key", "http://127.0.0.1:1"),
|
||||
{} if override is None else {"PYTHONFAULTHANDLER": override},
|
||||
(),
|
||||
{} if inherited is None else {"PYTHONFAULTHANDLER": inherited},
|
||||
)
|
||||
assert environment["PYTHONFAULTHANDLER"] == "1"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("explicit", (False, True))
|
||||
@pytest.mark.parametrize("remove", (False, True))
|
||||
def test_owned_runtime_configuration_preserves_custom_worker_startup_hooks(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue