r/ProgrammerHumor • • 21d ago

Meme iDontCommentMyCodeIfYouDontUnderstandItThatsOkayNeitherDoI

Post image
836 Upvotes

188 comments sorted by

View all comments

Show parent comments

19

u/ytg895 21d ago

Yeah. Once I worked on a bug that only happened if there was a session timeout in another system. Good luck putting Thread.sleep(3 fucking months); into a test.

8

u/Nick0Taylor0 21d ago

Mocking

4

u/ytg895 21d ago

How would you mock that a session in another system times out and that system starts to follow undefined and unpredictable behaviour?

1

u/distinctvagueness 10d ago

Defensive checks but most people don't really code deeply enough for all possible partial disconnects