Unit tests are flakey and should not rely on sleeps to keep them in order. Replace all sleeps with patched Mock values to trigger on expected outcome. Add a timeout for failing tests. https://docs.python.org/3/library/unittest.mock.html