The pollers originally were designed without a way of stopping the background
polling thread. In practice, we probably don't really need a way of closing
the thread, but in unit tests, we need a way of killing the background thread
when the test ends, otherwise the tests spawn a bunch of threads that never
stop running.
I'm not sure why the existing tests never triggered this problem, but when we
change the pollers to be record queue based, I'm seeing this issue, so fixing
the tests ahead of that change.
Coverage increased (+0.1%) to 84.855% when pulling 7a1d6086b7bfefef9b8561baf6e0e72d2bd8d449 on mtlynch:closable-pollers into 543b6d777297263385acce267fbce777434faa49 on JeetShetty:master.
The pollers originally were designed without a way of stopping the background polling thread. In practice, we probably don't really need a way of closing the thread, but in unit tests, we need a way of killing the background thread when the test ends, otherwise the tests spawn a bunch of threads that never stop running.
I'm not sure why the existing tests never triggered this problem, but when we change the pollers to be record queue based, I'm seeing this issue, so fixing the tests ahead of that change.