We raised $3M for agent-native runners

Build the test database once for all workers

Have one parallel worker apply the schema while the others wait for it, so more workers stop repeating the same setup.

How Ramp used this technique

Read what Ramp changed and follow the original sources.

Build the test database once for all workers

Ramp's test setup recreated the database from scratch by applying every migration, and each pytest-xdist worker ran that setup in parallel. At higher worker counts the concurrent schema changes ran Postgres out of working memory and repeated the same work. Ramp restructured the setup so one worker applies the schema, which let it run more workers on a machine twice the size.

Coordinating the schema setup let Ramp double the machine size and halve CI test times, which had been creeping up towards 20 minutes. Source

Use it when
Tests run in parallel workers that each repeat the same database or fixture setup, and raising the worker count stops paying off.
Before applying it
The other workers wait for the one that builds the schema, so the setup itself still sets a floor on the job's time.

Company Playbooks