diff --git a/tests/integration/_support/process.py b/tests/integration/_support/process.py index 09f562586be..77285086755 100644 --- a/tests/integration/_support/process.py +++ b/tests/integration/_support/process.py @@ -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 ( diff --git a/tests/unit/integration_support/test_process.py b/tests/unit/integration_support/test_process.py index e5e9cd7f889..edaa03db096 100644 --- a/tests/unit/integration_support/test_process.py +++ b/tests/unit/integration_support/test_process.py @@ -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(