Our test environments took 25 minutes. Now they take 3 seconds, and the build is no faster
One command gets me a test environment in about 3 seconds. It’s a private copy of our whole platform running the latest main, waiting for my change. When I push a commit, it’s running there a few seconds later.
Not long ago, the same thing took 25 minutes. The build didn’t get faster. It’s still just as slow.
Anyscale was founded by the people who created Ray. When I joined, I was impressed by how smart the ML researchers and engineers around me were. For the longest time I assumed nothing here could be faster or better. If it had been fixable, surely one of them would have fixed it.
Then I looked at it properly. Testing four lines of Python in a test environment took the average person about 25 minutes. What shocked me wasn’t the number: nobody seemed bothered. I think very smart people are also very good at living with a bottleneck. You batch your changes, start an environment and go do something else. After a while the wait stops being a problem. It becomes the weather.
To be fair, it’s an honest 25 minutes. A test environment here isn’t just an app you start. It’s a small copy of the whole platform: many services, a database and real cloud resources. All of it gets built, deployed and waited on.
I’m not the obvious person to fix that. I like working close to design and product. Right now I’m responsible for all the dual-write paths in our RBAC effort. That’s plenty to keep me busy. I do question things, though. I also had a selfish reason: I had started running several coding agents at once. Each one needs its own environment to check its work. So I started chipping away at it.
First I kept environments alive so I never waited for a new one. That worked until the bill showed up. Next I put a queue in front of a couple of slots. The waiting got orderly and not one second shorter. I proposed mocking the slow external services and got turned down. Rightly, I think: somebody has to keep a mock honest for as long as it exists. Redeploying only what changed got a rebuild down to a few minutes. That’s where I stalled for months.
Every time a new model came out, I handed it the whole setup. I asked how to make it faster. Every time I got a thoughtful plan to speed up the steps we already had.
None of them questioned whether we needed the steps.
Then on a Saturday afternoon I asked an agent a different question. How does Vercel make a preview deployment feel instant? What can we borrow?
I don’t know Vercel’s internals. A Next.js app is far simpler than what we run. Still, the general answer travels well. Reuse whatever hasn’t changed. Treat a deploy as a small diff on top of something that already exists. Don’t keep idle things running. Held up against that, rebuilding everything for every environment looked silly. That’s when the thought landed:
If building takes so long, what if we just don’t build?
Here’s what it does now:
- It starts from a snapshot. CI was already producing a verified build of main. New environments start from that instead of nothing.
- A few are kept warm. Getting an environment means claiming one that’s already running. That’s where the 3 seconds comes from. If no spare is ready, making one from the snapshot takes about 4 minutes.
- Your change is an overlay. Only the changed files get copied onto the running services. Front-end and Python changes land in seconds. Go was the holdout. Now the build graph says which outputs changed. Only those get pushed into the running environment. A Go change is live in about 30 seconds.
- It sleeps. After 45 minutes idle, an environment hibernates. Waking it takes about 3 minutes.
None of this is new. The snapshot wasn’t even my work. It had been sitting in CI the whole time.
It also has real limits. Dependency changes still take the slow path. The Go part is still a draft, with me as the main user. The 3 seconds depends on a free spare and a good snapshot. A colleague who knows the build far better than I do pushed me toward the build graph. He also pointed out that the real fix is a faster build. I think he’s right. What I built is a detour. The road is still closed.
The best models available looked at this for months and kept polishing the pipeline. What unlocked them wasn’t a smarter model: it was a reference from outside the problem. I’m honestly not sure whether that says more about the models or about me. I had asked for a faster build. A faster build is exactly what I kept getting.
A model will happily make your question better. I don’t think it will tell you it’s the wrong question, at least not yet.
That part still seems to be ours.
If you have a slow environment of your own, I’m guessing the constraints sound familiar. It has to behave like the real thing, or the test tells you nothing. Some of the slow parts belong to somebody else. Idle environments cost money while fresh ones cost time.
I dictate with Wispr Flow. This is roughly what I’d hand your coding agent:
Don't propose fixes yet. Time every step of creating a fresh test
environment from a new branch. Which steps cost the same every time,
and which depend on what changed?
Then explain, in general terms, how Vercel makes a preview deployment
feel instant. What has to be true for that to work?
Now compare that with our setup. What can we borrow? Aim for a usable
environment in seconds, not a faster build. Prefer things we already
produce, like the last good build of main. List the kinds of change
that would still need the slow path.
Swap Vercel for whoever has solved an easier version of your problem.
I still think the people around me are smarter than I am. I just don’t think that means the slow thing has to be slow anymore. Somewhere in your week there’s a 25 minutes that everyone agreed on a long time ago. I’d start by asking who agreed.