services: stop tests before panicking#347
Conversation
This was done because the test would panic occasionally. First step is to not let it panic.
|
Maybe dumb question but what's the problem with it panicing ? It'll juts fail the current tetst right ? |
Yes, but that's what t.Fatalf is for imo, if code panics it usually indicates to me that something in the code is wrong and something unexpected is happening. It's better imo if test output is clear, and panics make things messy. It's like you're trying to continue testing with invalid data because there's been an error upstream but the test was allowed to continue. |
hhhmm I don't think that's completely right. I think your change is OK anyways for other reasons; in most of the places you're now using |
Yeah, it wouldn't be meaningful to continue the tests, I agree. That's my reason. I get that we want to find panics if they're cause by code that we're testing, but the test code shouldn't be panicking because they didn't stop at the right time. |
Yes agreed, the testing code shouldn't be panicing 😄 |
This was done because the test would panic occasionally. First step is to not let it panic.
The panic I'm referring to is #346 .