mix tasks.sqlite.stress (snodo_tasks_sqlite v0.5.0)

Copy Markdown View Source

Runs Snodo.Extensions.Tasks.Stress against a file-backed SQLite store.

mix tasks.sqlite.stress
mix tasks.sqlite.stress --tasks 200 --writers 16 --rounds 10 --json

Each run creates a WAL database in a new, randomly named temporary directory, migrates it, starts a pooled Repo, runs the shared harness, and deletes the directory. This task lives in the repository only; it is not in the published package. It accepts the mix tasks.stress switches (--timeout-ms bounds each harness wait, not the whole run; see Snodo.Extensions.Tasks.Stress) plus:

  • --pool-size N - Repo connections (default 5)
  • --busy-timeout-ms N - SQLite busy timeout (default 5000)
  • --store-timeout-ms N - store :timeout (default 15000)

{:error, :database_busy} is the store's documented backpressure result, so the report counts it as busy rather than as an unexpected error. The harness still checks each Task's ledger and snapshot, so a busy result that hid a commit fails the run.

Summary

Functions

Prepares a temporary SQLite database, runs the harness, and returns its report.

Functions

soak(harness_opts, sqlite_opts \\ [])

Prepares a temporary SQLite database, runs the harness, and returns its report.

Requires the :snodo_tasks_sqlite application to be running.