mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-29 12:28:43 +08:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user