Skip to content

fix(FastAPI): Improve sqlite testing speed

Kevin Morris requested to merge kevr/aurweb:pu_sqlite_testing into pu

fix(FastAPI): Improve sqlite testing speed

This commit adds a new Arch dependency: libeatmydata, which provides the eatmydata executable that stubs out fsync() operations. We use eatmydata to run our sharness and pytests in Docker now.

With autocommit=True, required by SQLAlchemy to keep the session up to date with external DB modifications, many fsync calls are used in the SQLite backend; especially because we're wiping and creating records in every DB-bound test.

Before:

  • mysql: 1m42s (elapsed during pytest run)
  • sqlite: 3m06s (elapsed during pytest run)

After:

  • mysql: 1m40s (elapsed during pytest run)
  • sqlite: 1m50s (elapsed during pytest run)

Closes #120 (closed)

Signed-off-by: Kevin Morris kevr@0cost.org

Edited by Kevin Morris

Merge request reports