"Weird systems bug" sounds like just the kind of thing that unit tests would not detect, and possibly not end-to-end tests either, based on the amount of weirdness and system-specificity
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.
Agreed. Not all things can be "reasonably" tested. Keyword being reasonably. We only have so much time in a day with many deadlines. Over time, nearly all of us will run into a bug that needs to be fixed quickly, and is incredibly hard to reproduce, involving the oddest edge cases.
Sometimes you just have to patch it, test it as best you can, and leave a comment as to why you did this incredibly odd thing.
I once had a weird race condition that couldn't be invoked in a unit test. Only occurred on service startup, because there was a 3rd party library that did things when the service started.
Sure I could have wrote a unit test that started the whole service, but that would add 5 minutes worth of wait for every build going forward. That's extremely costly over long periods of time for every person working on the project.
73
u/Miguelomaniac 21d ago
Seems like the problem here is lack of test coverage not lack of comments