3 ms·
For networking related problems you can deterministically control failures from the test using something like Toxiproxy. This can be especially useful if you’re
by dropofwill 6y ago
For networking related problems you can deterministically control failures from the test using something like Toxiproxy. This can be especially useful if you’re working out a particular bug (e.g. gracefully handling a split brain situation or something).
A more general approach would be to just run your happy path tests while wrecking the environment (e.g. randomly killing instances, adding latency, dropping packets, whatever).
I’ve found that the latter often uncovers problems that you can use the former to solve.
Testing these sort of things with unit tests can work, but I’m more confident in tests that run on a ‘real’ networking stack, instead of e.g. mocking a socket timeout exception.
- gvjddbnvdrbv 6y agoThis is more integration testing than unit testing. Certainly valuable but it shouldn't replace your unit tests.
- dropofwill 6y agoYeah, reading it again I mixed up what you wrote with someone else.