4 ms·
> Do you really need tests for the read(2) syscall when Linux is running on a billion devices, and that syscall is called some 10^12 times per second globally?
by thunky 4y ago
> Do you really need tests for the read(2) syscall when Linux is running on a billion devices, and that syscall is called some 10^12 times per second globally?
Maybe not, but isn't it true that any new code that is being added to the kernel has been run on exactly 0 devices? And new code is being added all the time.
Maybe that's why the most recent commit as of right now is loaded with fixes of broken things: https://github.com/torvalds/linux/commit/08ad43d554bacb9769c6a69d5f771f02f5ba411c https://github.com/torvalds/linux/commit/08ad43d554bacb9769c...
It's one thing to say that it's impossible to test effectively locally before release (which I'm not sure if that's true or not). But you're saying it's just not worth testing because it'll break in real life and that's even better, which I"m not sure I can agree with.
- sph 4y ago> Maybe that's why the most recent commit as of right now is loaded with fixes of broken things Are you saying that if Linux had tests, there would be no bugs?
- agent281 4y agoI think that's a bit of a strawman. I don't think anyone says tests prevent all bugs. They can help fix some parts of the contract down and give you a place to check against regressions.
- sph 4y agoGP pointed out to a bug fix commit as proof that the kernel would benefit from having tests, so it's not that much of a straw man.
- svenpeter 4y agoThat merge only has fixed because of how the development model works: there’s a merge window where new features are merged and which then becomes -rc1. After that only fixes are allowed until the final release of that version and then the merge window opens again.
- thunky 4y agoThat makes sense, so I just picked another commit at random without a -rc tag: https://github.com/torvalds/linux/commit/c60c152230828825c06e62a8f1ce956d4b659266 https://github.com/torvalds/linux/commit/c60c152230828825c06... The fix is to change && to || This seems like the exact type of bug that a unit test could prevent.