From b90ac69841ed0d5afac6f0cbf790f0dcc02bbbd3 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 15 Nov 2026 06:15:35 +0000 Subject: [PATCH] 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> --- tests/integration/_support/process.py | 1 + tests/unit/integration_support/test_process.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) 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(