How Threadmill is tested
A job engine is infrastructure. You should be able to see how it is verified before you trust it with production work. Everything described here is in the repository and runs from the Gradle build.
One contract for every store
PostgreSQL, Oracle, Redis and the in-memory store all pass the same abstract contract suite. The in-memory store is not a simplified fake, so a test that passes locally exercises the same rules as production. A new store is accepted only when it passes the full suite.
An explicit state machine
Every job state and every allowed transition is defined in one table. Illegal transitions throw. The table is tested exhaustively.
Real datastores, real topologies
Store tests run against real PostgreSQL, Oracle and Redis in containers. Redis is tested in standalone, Sentinel and Cluster setups, including failover.
Soak regression
A fixed suite, separate from the unit tests, checks three things on every durable store:
- Sustained throughput: thousands of jobs driven end to end, all reaching a final state.
- Recurring without skips: a tight-interval task fires every interval, with no catch-up storm.
- Datastore outage: the database container is paused mid-run. The engine pauses itself, and resumes without a restart when the store returns.
Load harness with live invariants
A separate harness runs one scenario against one store for as long as you choose: bulk enqueue, mixed workloads, retry storms, long-running jobs, pause and resume, crash and recover, weighted queues. While it runs, it verifies invariants on the live trace and stops at the first violation. It can restart nodes during the run and can target your own datastore.
Endurance runs
Before a release, the harness runs for hours against PostgreSQL and Redis in parallel, with node churn and live verification, and produces a single verdict.
Supply chain
Dependencies are locked and checksum-verified. Every pull request and release is scanned for known vulnerabilities.
What we do not claim
We do not publish throughput numbers as capacity promises. Hardware, datastore configuration, payload size and handler duration change the result too much. The harness is in the repository so that you can measure on your own infrastructure.