From 4194cd1c307184bc7642092e37a1ce85b0b1b406 Mon Sep 17 00:00:00 2001 From: Darek Date: Fri, 23 Oct 2026 00:02:14 +0200 Subject: [PATCH] test(timeout): give the settings tests' database the suite's 1 GiB max_db_size On the C-API backend, every test_timeout.py test that uses the conn fixture failed at random in setup with "Buffer manager exception: Mmap for size 8796093022208 failed." The fixture opened lb.Database(":memory:") with the default max_db_size, which reserves 8 TiB of address space. By then 14 default-size databases from test_fsm.py, test_database.py and test_exception.py are still mapped, because the C-API Database frees its native database only in close() or at exit. The rest of the 128 TiB is often split into gaps smaller than 8 TiB. The fixture now passes max_db_size like the conftest's databases. Co-Authored-By: Claude Opus 5.5 --- test/test_timeout.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_timeout.py b/test/test_timeout.py index bf8f091..66155aa 100644 --- a/test/test_timeout.py +++ b/test/test_timeout.py @@ -40,9 +40,9 @@ def _interrupt_until_done(conn: lb.Connection, *threads: threading.Thread) -> No @pytest.fixture -def conn() -> Iterator[lb.Connection]: +def conn(max_db_size: int) -> Iterator[lb.Connection]: # A fresh connection: the shared read-only one carries other tests' settings. - db = lb.Database(":memory:") + db = lb.Database(":memory:", max_db_size=max_db_size) conn = lb.Connection(db) yield conn conn.close()