From fb92fb509b4a5769154096969cbfb90f8f69e798 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Wed, 17 Nov 2021 00:49:00 -0800 Subject: [PATCH] change(fastapi): use sys.getrecursionlimit() + 1000 as default Without the increment, we've seen tests failed due to recursion errors caused by starlette's base middleware. Just make it safe in case nobody supplies TEST_RECURSION_LIMIT. Signed-off-by: Kevin Morris --- aurweb/asgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aurweb/asgi.py b/aurweb/asgi.py index aafb00b2..b399cfb1 100644 --- a/aurweb/asgi.py +++ b/aurweb/asgi.py @@ -45,7 +45,7 @@ async def app_startup(): # when running test suites. # TODO: Find a proper fix to this issue. recursion_limit = int(os.environ.get( - "TEST_RECURSION_LIMIT", sys.getrecursionlimit())) + "TEST_RECURSION_LIMIT", sys.getrecursionlimit() + 1000)) sys.setrecursionlimit(recursion_limit) backend = aurweb.config.get("database", "backend")