Acceptance suite
End-to-end tests that check Foreman's guarantees against a real Postgres: no
lost jobs under kill -9, exactly-once periodic ticks across leader crashes,
transactional enqueue, per-key limits, unique jobs, recovery from connection
loss, cancellation, throughput, latency, fairness and a one-hour soak. The
numbers in the README and in bench/RESULTS.md come
from these tests.
Running
make acceptance # every criterion, reference-machine thresholds
make acceptance CI=1 # CI thresholds (smaller loads, shorter runs)
make acceptance ONLY=FMN-01,FMN-07 # a subset
The runner (acceptance/cmd/runner) builds the project, starts the stack in
deploy/docker-compose.yml (Postgres and
Toxiproxy on ports 55432, 55433 and 58474), runs each criterion with a fresh
test cache, writes acceptance/report.md, and stops the stack.
Requirements:
- Docker with at least 8 CPUs and 20 GB of memory for the VM (the reference
machine is a MacBook Pro M3 Pro with 36 GB; see
machine in criteria.yaml);
- Go 1.27;
- 1.5 to 2 hours for a full run on the reference machine (FMN-12 alone runs
for one hour);
CI=1 shortens the soak to 10 minutes and uses smaller loads.
Environment variables (optional): FOREMAN_ACC_DATABASE_URL,
FOREMAN_ACC_PROXY_DATABASE_URL and FOREMAN_ACC_TOXIPROXY_URL point the
tests at an existing stack; CI=1 selects the CI thresholds.
Criteria
Each criterion has an id, a test named after it (TestAcceptance_FMN01_… or
BenchmarkAcceptance_…) and thresholds for two environments in
criteria.yaml: pass.mac for the reference machine and
pass.ci for CI runners. Tests read the thresholds at run time.
| ID |
Kind |
What it checks |
| FMN-01 |
functional |
No lost jobs with random kill -9 of workers and the leader |
| FMN-02 |
functional |
Periodic jobs enqueued exactly once per tick across leader crashes |
| FMN-03 |
functional |
Rolled-back transactions leave no jobs |
| FMN-04 |
performance |
Throughput of no-op jobs with 4 clients × 50 workers |
| FMN-05 |
performance |
Pickup latency at a steady 1,000 inserts/s |
| FMN-06 |
performance |
Fairness under overload keeps a small tenant's wait low |
| FMN-07 |
functional |
The per-key concurrency limit is never exceeded across clients |
| FMN-08 |
functional |
Concurrent unique inserts from Go and SQL yield one job per key |
| FMN-09 |
functional |
A frozen worker's job is rescued and its stale completion rejected |
| FMN-10 |
functional |
Clients recover from a 30 s connection loss without losing results |
| FMN-11 |
functional |
Cancelling running jobs cancels their context within 1 s |
| FMN-12 |
performance |
Table size and latency stay stable over a one-hour soak |
| FMN-13 |
release |
The README quickstart works from a clean checkout |
Performance criteria are calibrated for the reference machine. On any other
host the runner applies the CI thresholds and says so in the report.
The report
report.md has one row per criterion with the result, the measured values
and the thresholds. Per-criterion logs (acceptance/logs/<ID>.txt and
.json) are written locally during the run and are not committed.
Results are:
- PASS: every measured value meets its threshold;
- FAIL: a measured value misses its threshold; listed again under
"Not met";
- Skipped (environment): a required capability (for example Docker) is
missing on this host. The runner, not the test, decides when a criterion is
skipped;
- Blocked (environment): the capability exists but the reference-machine
thresholds cannot apply (for example a performance criterion on a host other
than the reference machine).
Before running, the runner also checks that every criterion has exactly one
test with its id and that the test name matches criteria.yaml; any mismatch
fails the run.