HackerTrans
TopNewTrendsCommentsPastAskShowJobs

sunshowers

2,534 karmajoined il y a 3 ans
Rust person, eng @ Oxide, nextest maintainer, they/she. former vcs dev (you should use jj!)

hn at <username>.io

Submissions

In defense of lock poisoning in Rust

sunshowers.io
60 points·by sunshowers·il y a 7 mois·6 comments

comments

sunshowers
·il y a 24 heures·discuss
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".
sunshowers
·avant-hier·discuss
Look, you can either let people make a living and manage their own lives while contributing to society, or you can not let them make a living and ensure they're housed and fed. You can't be angry at A and also be angry at B.
sunshowers
·avant-hier·discuss
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!)
sunshowers
·avant-hier·discuss
From what I can tell, a big part of the problem in Europe is that people seeking asylum are prohibited from making a living (due to widespread belief in the lump of labor fallacy) and so have to be dependent on welfare.
sunshowers
·avant-hier·discuss
The benchmarks are against non-doctest cargo test runs. (But you should measure against your own project, of course!) Unfortunately Cargo doesn't provide enough information for nextest to run doctests reliably with.
sunshowers
·avant-hier·discuss
I think in practice you're right that GitHub Actions' caching slowness can end up dominating performance. I don't have any great tips other than to measure.
sunshowers
·avant-hier·discuss
> 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.
sunshowers
·il y a 3 jours·discuss
Thanks! BTW you might enjoy setting CARGO_TERM_COLOR=always in your environment :) dtolnay/rust-toolchain does this automatically but it looks like you aren't using that action.
sunshowers
·il y a 3 jours·discuss
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.
sunshowers
·il y a 3 jours·discuss
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/
sunshowers
·il y a 3 jours·discuss
Yeah that was indeed the inspiration (though I'm pretty sure it predates Kubernetes!) but the juxtaposition with "terminate" is unfortunate.
sunshowers
·il y a 3 jours·discuss
That's fair! I'll find a way to rephrase it.

edit: Updated to "Detect and handle slow tests". Thanks again!
sunshowers
·il y a 3 jours·discuss
That is indeed the pun =)
sunshowers
·il y a 3 jours·discuss
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.
sunshowers
·il y a 16 jours·discuss
I'm sure you're aware there's a huge amount of computation that isn't matrix multiplication :)
sunshowers
·il y a 16 jours·discuss
My successful application took around 12 hours of writing and editing across 3 days, though I was lucky that most of my portfolio was already open source or otherwise public. Some people spend more, some spend less.

It is worth keeping in mind that we write a _lot_. If you don't enjoy the process of writing, you might not like working here.
sunshowers
·il y a 25 jours·discuss
We have a number of TLA+ models at Oxide. Here's one:

https://github.com/oxidecomputer/omicron/blob/8b0886dbd02229...
sunshowers
·il y a 25 jours·discuss
Updated https://oxide.computer/blog/iddqd-unsafe#what-about-formal-m... with some notes.
sunshowers
·il y a 26 jours·discuss
Mostly chatted with some people and figured it out with their help.
sunshowers
·il y a 26 jours·discuss
Rust is a beautiful language. Gorgeous.