Skip to main content

max / makenotwork

pom: give multithreaded a DATABASE_URL, and cap build parallelism lower The multithreaded suite runs two harnesses. Most tests use the hand-rolled TestDb, which reads TEST_DATABASE_URL. The admin and bans modules use #[sqlx::test], which reads DATABASE_URL and manages its own throwaway databases. Setting only the first left those 29 failing with "DATABASE_URL must be set", which reads like a broken module rather than a missing variable. With both set the suite is green: 294 passing. CARGO_BUILD_JOBS drops to 8. MemoryMax applies to the whole pom.service cgroup rather than per invocation, and a sweep that finds several targets stale at once runs them concurrently under that one ceiling.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-06 21:48 UTC
Signed with PGP, not checked
Commit: c305c07274580a468ffa03c5f22b4b16364ed2b9
Parent: bfa46bf
1 file changed, +18 insertions, -2 deletions
@@ -40,7 +40,12 @@
40 40 # concurrent rustc processes on the MNW server workspace peaked past 16G and 20G
41 41 # of swap before the cgroup killed it. This is a memory cap wearing a job-count
42 42 # costume; the wall-clock cost is small next to thrashing.
43 - export CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-16}"
43 + #
44 + # 8 rather than 16 because MemoryMax applies to the whole pom.service cgroup,
45 + # not per invocation, and a sweep that finds several targets stale at once runs
46 + # them concurrently under that one ceiling. Caches are warm in the steady state,
47 + # so few crates actually rebuild and the job count barely shows up in wall clock.
48 + export CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-8}"
44 49
45 50 # The mirrors are max's, this runs as pom, and git refuses a repo it considers
46 51 # foreign. Without this every fetch below fails and the clones silently test
@@ -112,8 +117,19 @@
112 117 sqlx migrate run --source migrations --database-url "$DATABASE_URL"
113 118 ;;
114 119 mt)
120 + # Two harnesses in one suite. Most tests use the hand-rolled `TestDb`,
121 + # which reads TEST_DATABASE_URL. The `admin` and `bans` modules use
122 + # `#[sqlx::test]`, which reads DATABASE_URL and manages its own throwaway
123 + # databases off it. Set only the first and those 29 fail with
124 + # "DATABASE_URL must be set", which reads like 29 broken tests rather
125 + # than one missing variable.
126 + DATABASE_URL='postgres:///pom_ci_mt'
115 127 TEST_DATABASE_URL='postgres:///postgres'
116 - export TEST_DATABASE_URL
128 + export DATABASE_URL TEST_DATABASE_URL
129 +
130 + psql "$TEST_DATABASE_URL" -tAc \
131 + "SELECT 1 FROM pg_database WHERE datname = 'pom_ci_mt'" \
132 + | grep -q 1 || createdb pom_ci_mt
117 133 ;;
118 134 esac
119 135