4 ms·
Are you joking? This is the kind of thing that leads to flaky tests. I was always counseled against the use of randomness in my tests, unless we're talking gene
by devin 6mo ago
Are you joking? This is the kind of thing that leads to flaky tests. I was always counseled against the use of randomness in my tests, unless we're talking generative testing like quickcheck.
- whynotmaybe 6mo ago`today` is random.
- Eldt 6mo agoIt's dynamic, but it certainly isn't random, considering it follows a consistent sequence
- InsideOutSanta 6mo agoIf "today" were random, our universe would be pretty fricken weird.
- devin 5mo agoWhat is today right now in Australia? How about where you live? You have not thought enough about what you’re saying and are probably not aware of all the weird time issues we have in our world.
- InsideOutSanta 5mo agoThat's not what "random" means.
- dathinab 6mo agoor, maybe, there is something hugely wrong with your code, review pipeline or tests if adding randomness to unit test values makes your tests flaky and this is a good way to find it
- devin 6mo agoor, maybe, it signals insufficient thought about the boundary conditions that should or shouldn't trigger test failures. doing random things to hopefully get a failure is fine if there's an actual purpose to it, but putting random values all over the place in the hopes it reveals a problem in your CI pipeline or something seems like a real weak reason to do it.
- tomjakubowski 6mo agoI don't think anyone is advocating for random application of randomness.