News for hackers. Stuff that matters.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by sunshowers on Thursday July 09, 2026 @01:48AM (#48841464)
Thanks for posting about this! I'm the main author of nextest, and it represents my best foot forward for how Rust testing should be done. Happy to answer questions though I might be a bit intermittent.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by mrec on Thursday July 09, 2026 @03:48AM (#48842317)
Have there been any discussions about upstreaming this into cargo proper? Are there any significant downsides to nextest compared to its predecessor?
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by sunshowers on Thursday July 09, 2026 @03:50AM (#48842328)
The How it works [1] and Why process-per-test? [2] pages should answer your questions.

[1] https://nexte.st/docs/design/how-it-works/

[2] https://nexte.st/docs/design/why-process-per-test/

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by mrec on Thursday July 09, 2026 @03:52AM (#48842354)
Ah, I see. You're aiming to become the hashbrown of testing.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by sunshowers on Thursday July 09, 2026 @03:57AM (#48842387)
Oh gosh, were we to be so lucky :) just aiming to solve problems my coworkers and users see, and doing it with care, is all.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by landr0id on Thursday July 09, 2026 @02:12AM (#48841632)
Big fan of nextest and this is my first time seeing this site. I'll be real I feel a bit ridiculous commenting this but you might want to consider rephrasing this:

>Treat tests as cattle, not pets. Detect and terminate slow tests.

Not sure saying, "hey, treat your tests as an animal you can kill at will" paints the right image.

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by trollbridge on Thursday July 09, 2026 @02:29AM (#48841759)
This is from the Kubernetes saying of "treat servers like cattle, not pets". Of course, some people like me keep cattle as pets, but then again I also name my servers, even the virtual or containerised ones.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by sunshowers on Thursday July 09, 2026 @02:33AM (#48841776)
Yeah that was indeed the inspiration (though I'm pretty sure it predates Kubernetes!) but the juxtaposition with "terminate" is unfortunate.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by wojciii on Thursday July 09, 2026 @03:13AM (#48842041)
I liked the way it was phrased. You can't make everybody happy. :)
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by seanhunter on Thursday July 09, 2026 @05:41AM (#48843308)
It’s a horrible saying in that context also.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by embedding-shape on Thursday July 09, 2026 @07:28AM (#48844152)
I mean, I like animals too, but in context it does make sense. The context was to treat them as "obtainable yet ultimately killable entities you keep as a group, not individuals", which cattle pretty much is. Unless you consider keeping cattle as draft animals, but I think that stopped being the main purpose a long time ago.

It got the point across, at a time where most people basically acquired servers, kept them until they died, and he was trying to push a development workflow where you constantly close("kill")/bring up new servers.

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by entrope on Thursday July 09, 2026 @09:20AM (#48845390)
IMO, "make your servers fungible" is a better way to express the intent: slightly shorter, no metaphors, although "fungible" is a less common word. Maybe that's just me. (Edited to add: "make your tests fungible" has I think the wrong connotation; I think the original wording on the blog is about test executions -- and "make your test executions fungible" does seem like a good goal, similar to ACID guarantees for database transactions.)
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by embedding-shape on Thursday July 09, 2026 @09:38AM (#48845661)
Before that, I used to call them "ephemeral", and of course half the people asked what "ephemeral" means, probably "fungible" would be met with similar question, unless the crowd is cryptocurrency-adjacent, that term seems understood there.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by jen20 on Thursday July 09, 2026 @09:08AM (#48845248)
That (unpleasant) saying predates Kubernetes by at least half a decade.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by nixosbestos on Friday July 10, 2026 @11:32PM (#48868456)
Who here is old enough to know about PetSets, since we're talking this topic and k8s...
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by sunshowers on Thursday July 09, 2026 @02:29AM (#48841753)
That's fair! I'll find a way to rephrase it.

edit: Updated to "Detect and handle slow tests". Thanks again!

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by mhluongo on Thursday July 09, 2026 @08:17AM (#48844666)
It resonated with me!
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by Zababa on Thursday July 09, 2026 @08:35AM (#48844916)
Fungible/non fungible is a good alternative, and maybe the technically correct word. But I think in that case it doesn't apply and the change the author did is better.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by 27183 on Thursday July 09, 2026 @10:32AM (#48846537)
"Treat tests as annuals not perennials"

"Treat tests as workers not management"

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by moi2388 on Friday July 10, 2026 @07:43AM (#48858601)
Jesus Christ do we seriously need to limit our speech and get rid of perfectly good analogies for every special little snowflake?
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by sunshowers on Friday July 10, 2026 @07:13PM (#48866549)
Like all things in life, there is a balance :) I didn't remove the cattle vs pets analogy but I did replace "terminate" with "handle".
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by gdcbe on Thursday July 09, 2026 @04:27AM (#48842649)
Thank you very much for developing nextest. It is what allows our projects like rama [1] to run thousands and thousands of tests in a blink of an eye! Keep it up!

[1] https://ramaproxy.org

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by coding-wizard on Thursday July 09, 2026 @08:30AM (#48844825)
Hey, I love nextest. But, perhaps because of the one-process per test approach, endpoint security solutions like CrowdStrike Falcon or Palo Alto Cortex tend to make computers hang whenever tests kick-in. I would love if you were able to introduce a workaround, because none of those companies will fix their stuff. I am guessing a possible mitigation would be to have stagger the first invocation of any large test binary, but I haven't had a chance to dig deep into this issue.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by sunshowers on Thursday July 09, 2026 @12:15PM (#48848322)
Nextest does run tests in lexicographic (binary, test name) order by default, so first executions tend to be staggered. Unfortunately this is a known problem that is much larger than nextest, and it is why Windows introduced Dev Drive with a mode to disable AV/EDR on those drives entirely.

I wish I had a better answer here — it is frustrating how poorly behaved the EDR stuff tends to be. Maybe I should try and network a bit to get in touch with the people working on this stuff. (Planning to be at DEF CON this year, so come find me if you work on this stuff and will be there!)

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by arw0n on Thursday July 09, 2026 @08:54AM (#48845099)
Wouldn't running the tests in a container solve that issue? Or is that another thing that gets flagged?
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by cogman10 on Thursday July 09, 2026 @10:22AM (#48846374)
First, I like how all this works, it's great.

Can you run tests serially in the (horrible) case when tests need to build on one another?

How are you querying for the tests? Is that just built into rust's test stuff?

Would it be possible to fork the test process? It'd be pretty interesting if you could spawn a test process, and then fork it for each test to save both on memory and any static state stored within the test.

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by sunshowers on Thursday July 09, 2026 @10:58AM (#48847026)
> Can you run tests serially in the (horrible) case when tests need to build on one another?

Yes: https://nexte.st/docs/configuration/test-groups/ (edit: though tests that build on each other is a bit harder — test groups are meant for when tests need access to a shared resource)

> How are you querying for the tests? Is that just built into rust's test stuff?

Just running --list against test binaries.

> Would it be possible to fork the test process? It'd be pretty interesting if you could spawn a test process, and then fork it for each test to save both on memory and any static state stored within the test.

This is possible in principle, but nextest doesn't really inject itself into tests like that (injection can cause reliability issues in practice, and a big focus of nextest is reliability). Forking is also not possible in multithreaded programs.

Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by dpc_01234 on Thursday July 09, 2026 @11:41AM (#48847759)
Thank you! It's great.
Re:Cargo-nextest: 3x faster than cargo test, per-test isolat... by thejosh on Saturday July 18, 2026 @09:15PM (#48964117)
nextest is one of those things I never have to think about, because it always "just works" and I have no dramas with it. <3