7aed8887

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.

Total

48s

Created Started Finished

Time to Start Worker time Duration Time to finish Idle
Config 0s 0s 0s 1s 0s
Eval 0s 13s 13s 14s 0s
Build 13s 34s 34s 48s 0s
Suite 0s 48s 48s 48s 0s

Timeline

Config Eval Build
0s10s20s30s40s