this post was submitted on 01 Sep 2024
947 points (98.4% liked)

Programmer Humor

32483 readers
318 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 40 comments
sorted by: hot top controversial new old
[–] Shameless@lemmy.world 152 points 2 months ago (1 children)

Was this taken from the Crowdstrike repo?

[–] CrypticCoffee@lemmy.ml 52 points 2 months ago (2 children)
[–] phorq@lemmy.ml 89 points 2 months ago (1 children)

Yup, and they're run on an estimated 8.5 million test machines

[–] GissaMittJobb@lemmy.ml 21 points 2 months ago

Testing in prod is a power move honestly. Rock star-level

[–] lobut@lemmy.ca 19 points 2 months ago (3 children)

Yeah, but I think apparently the tests that "could" have caught it relied on mocks which basically rendered it useless in those cases.

[–] teejay@lemmy.world 12 points 2 months ago

Ah yes. The unintended consequences of mandated code coverage without reviewing the tests. If you can mock the shit out of the test conditions to always give you exactly the answer you want, what's the point of the test?

It's like being allowed to write your own final exam, and all you need to pass the exam is 90% correct on the questions you wrote for yourself.

[–] CrypticCoffee@lemmy.ml 4 points 2 months ago

Unit tests, yes, but you don't only do unit tests. Integration and e2e tests still exist.

[–] marlowe221@lemmy.world 3 points 2 months ago

And this is why mocks are bad…

[–] SuperFola@programming.dev 79 points 2 months ago (5 children)

Who needs tests when you have users?

The testing environment is production!

[–] KillerTofu@lemmy.world 6 points 2 months ago (1 children)

I work in state government and we insist on building our own systems. This is too fucking true and why it’s funny.

[–] bamboo@lemmy.blahaj.zone 2 points 2 months ago (1 children)

What do you mean building our own systems?

[–] KillerTofu@lemmy.world 3 points 2 months ago

We build systems to manage day care licenses in the state instead of buying someone else’s product.

[–] HootinNHollerin@lemmy.world 6 points 2 months ago

-Crowdstrike

[–] Australis13@fedia.io 6 points 2 months ago

We work in protoduction.

[–] ipkpjersi@lemmy.ml 3 points 2 months ago (1 children)

Technically there's no substitute for testing in production lol

Although ideally you'd want to test it beforehand...

[–] _stranger_@lemmy.world 3 points 2 months ago

There are so many more, and better!, options than testing in prod, but they take time, money, and talent and ain't no company got time for that (for a business segment that "doesn't generate revenue")

[–] goferking0@lemmy.sdf.org 1 points 2 months ago (1 children)

Been microsofts strategy for how long?

[–] SuperFola@programming.dev 1 points 2 months ago

Probably too long. That was a philosophy I had at school and iirc the founders never finished school and started MS in a garage.

[–] _____@lemm.ee 45 points 2 months ago (2 children)

When the CI takes longer than 10 minutes

[–] ByteOnBikes@slrpnk.net 13 points 2 months ago (1 children)

Envious. It averages 15-30 mins

[–] residentmarchant@lemmy.world 9 points 2 months ago (2 children)

Are you like building a mobile app or have 100k tests or is it just super slow?

[–] ByteOnBikes@slrpnk.net 12 points 2 months ago

Still waiting on approval for more resources. It's not a priority in the company.

I swear we have like 4 runners on a raspberry pi.

[–] thebestaquaman@lemmy.world 2 points 2 months ago

My test suite takes quite a bit of time, not because the code base is huge, but because it consists of a variety of mathematical models that should work under a range of conditions.

This makes it very quick to write a test that's basically "check that every pair of models gives the same output for the same conditions" or "check that re-ordering the inputs in a certain way does not change the output".

If you have 10 models, with three inputs that can be ordered 6 ways, you now suddenly have 60 tests that take maybe 2-3 sec each.

Scaling up: It becomes very easy to write automated testing for a lot of stuff, so even if each individual test is relatively quick, they suddenly take 10-15 min to run total.

The test suite now is ≈2000 unit/integration tests, and I have experienced uncovering an obscure bug because a single one of them failed.

[–] spacecadet@lemm.ee 9 points 2 months ago

I used to have to use a CI pipeline at work that had over 40 jobs and 8 stages for checking some sql syntax and formatting and also a custom python ETL library that utilized pandas and constantly got OOM errors.

They didn’t write any unit tests because “we can just do that in the CI pipeline” and if you didn’t constantly pull breaking changes into your branch you would guarantee the pipeline would fail, but if you were lucky you only had to restart 30% of your jobs.

It was the most awful thing and killed developer productivity to the point people were leaving the team because it sucks to spend 40% of your time waiting for CI scripts to fail while you are being yelled at to deliver faster.

[–] Aceticon@lemmy.world 41 points 2 months ago* (last edited 2 months ago)

Who needs integration testing when we have users who will do it for us?!

[–] Blackout@fedia.io 26 points 2 months ago (1 children)

Lol. I run an open-saas ecom and everything is done live. No one but me handling it. The customers must think they are tripping sometimes. Updates are rarely perfect the first push.

[–] madcaesar@lemmy.world 18 points 2 months ago (1 children)

FUCK IT!!! WE'LL DO IT LIVE!!!

[–] ikidd@lemmy.world 18 points 2 months ago

"YOLO" - more than 1 merge comment I've seen.

[–] VantaBrandon@lemmy.world 13 points 2 months ago

"Works on my machine"

[–] TootSweet@lemmy.world 12 points 2 months ago

Mo' unit tests, mo' problems.

[–] some_guy@lemmy.sdf.org 10 points 2 months ago (1 children)

This is my favorite commit comment of all time.

[–] SwordInStone@lemmy.world 2 points 2 months ago

it's not a commit comment

[–] jaggedrobotpubes@lemmy.world 7 points 2 months ago (1 children)

I don't actually know enough to know anything about this but I'm assuming that's badass and you can only do it with sunglasses on

[–] hex@programming.dev 5 points 2 months ago

Badass or stupid and incompetent? Take your pick lol

[–] roguetrick@lemmy.world 6 points 2 months ago
[–] AdamEatsAss@lemmy.world 5 points 2 months ago

If QA cared about us they wouldn't make it so hard.

[–] edinbruh@feddit.it 5 points 2 months ago

I'm about to do this to this kernel driver. Certainly broken before, possibly broken after, what's the worst that could happen

[–] lowleveldata@programming.dev 4 points 2 months ago

ya man fuck those losers

[–] ExtraMedicated@lemmy.world 2 points 2 months ago

Also me at work.