Initial curated Unraid-AppOps-Gateway source from 3bd6f6fee310125bfbb4d4650389a817f498724d
This commit is contained in:
commit
1dfbca08a1
528 files changed
+131054
No files matched your search
@@ -0,0 +1,27 @@
|
||||
from pathlib import Path
|
||||
|
||||
from sqlmodel import SQLModel
|
||||
|
||||
from backend.app.db.session import create_app_engine
|
||||
|
||||
|
||||
def test_sqlite_engine_waits_for_busy_database_and_uses_wal(tmp_path):
|
||||
db_path = tmp_path / "runtime.db"
|
||||
engine = create_app_engine(Path(db_path))
|
||||
SQLModel.metadata.create_all(engine)
|
||||
|
||||
with engine.connect() as connection:
|
||||
busy_timeout = connection.exec_driver_sql("PRAGMA busy_timeout").scalar_one()
|
||||
journal_mode = str(connection.exec_driver_sql("PRAGMA journal_mode").scalar_one()).lower()
|
||||
|
||||
assert int(busy_timeout) >= 30000
|
||||
assert journal_mode == "wal"
|
||||
|
||||
|
||||
def test_sqlite_engine_allows_ui_request_bursts(tmp_path):
|
||||
db_path = tmp_path / "runtime.db"
|
||||
engine = create_app_engine(Path(db_path))
|
||||
|
||||
assert engine.pool.size() >= 20
|
||||
assert engine.pool._max_overflow >= 20
|
||||
assert engine.pool._timeout <= 10
|
||||
Reference in new issue
Block a user