From a4ad5a504c161bc3b1caaa40b22e46d600f7d4fc Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sat, 13 Jun 2020 17:26:02 -0700 Subject: [PATCH] Workaround for 'Too many open files' in test runs, refs #846 --- tests/fixtures.py | 3 +++ tests/test_api.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index e2f90f09..a4a96919 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -268,6 +268,9 @@ def make_app_client( "default_page_size": 50, "max_returned_rows": max_returned_rows or 100, "sql_time_limit_ms": sql_time_limit_ms or 200, + # Default is 3 but this results in "too many open files" + # errors when running the full test suite: + "num_sql_threads": 1, } ) ds = Datasette( diff --git a/tests/test_api.py b/tests/test_api.py index 1a54edec..322a0001 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1320,7 +1320,7 @@ def test_config_json(app_client): "suggest_facets": True, "default_cache_ttl": 5, "default_cache_ttl_hashed": 365 * 24 * 60 * 60, - "num_sql_threads": 3, + "num_sql_threads": 1, "cache_size_kb": 0, "allow_csv_stream": True, "max_csv_mb": 100,