7aed8887

Created Started Finished

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Scale the sqitch tests' timeout with the number of changes

The sqitch sanity checks shell out to sqitch once or more per change, so
their work grows with the plan, but sydtest's per-test timeout is one
fixed wall-clock budget. That budget therefore covers less of the job
with every migration added, and on a loaded machine it is blown: nix-ci
saw a <<timeout>> under `nix flake check` naming a different change each
time, which is the clock running out rather than a slow migration.

`withPlanScaledTimeout` multiplies the configured timeout by the number
of changes, so the headroom per change stays constant as the plan grows.
It honours what the caller configured rather than replacing it, so
`--timeout` still means something and no-timeout stays no-timeout.
Exported because the schema-equality check in
sydtest-sqitch-postgres-persistent deploys the whole plan too and has
the same problem.

A plan that cannot be read is not reported while sizing the timeout: the
tests read it again and fail with the reason, which is a test failure
rather than a crash during spec definition.