From 21382fbcad06ecd7a3b785529cf580fb0774a96d Mon Sep 17 00:00:00 2001 From: Simon Pinfold Date: Wed, 26 Aug 2026 20:10:05 -0700 Subject: [PATCH] test(db): fail the lock-release test with what a stranded lock costs setup_database logs and continues when assets are disabled, so a failed init that keeps the lock blocks every other instance for its whole lifetime. The assertion message says so; the acquire it replaces said nothing. --- tests-unit/app_test/test_db_init_locking.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests-unit/app_test/test_db_init_locking.py b/tests-unit/app_test/test_db_init_locking.py index 738a64275..896d4d1be 100644 --- a/tests-unit/app_test/test_db_init_locking.py +++ b/tests-unit/app_test/test_db_init_locking.py @@ -64,7 +64,14 @@ def test_failed_init_releases_the_lock(stale_db, monkeypatch): db_module._init_file_db(db_module.args.database_url) contender = FileLock(stale_db + ".lock") - contender.acquire(timeout=0) + try: + contender.acquire(timeout=0) + except Timeout: + pytest.fail( + "a failed init stranded the lock; setup_database logs and CONTINUES when assets are " + "disabled, so this process would block every other instance for its whole lifetime " + "over a database it never opened" + ) contender.release()