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 <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-17 00:49:00 -08:00
parent 60f63876c4
commit fb92fb509b
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -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")