flightstats / hub

fault tolerant, highly available service for data storage and distribution
http://www.flightstats.com
MIT License
103 stars 35 forks source link

Use lenient mocking for the statsd filter test. #1237

Closed lkemmerer closed 4 years ago

lkemmerer commented 4 years ago

We have tests against some boolean functions with mocked values that would short-circuit before evaluating the second part. We don't care which side is checked first, so the tests mock out both sides. This PR adds leniency to the mocking so we don't have to code up the tests in a way that implicitly indicates that order matters by only mocking the first side.

btw, I think something's weird with our test setup, because these tests don't fail consistently. This is already at least one level of yak shaving more than I'd like to do, so I'm going to put off trying to figure out why.