def test_rolling_window(self):
        # rough sleep to get us back on track
        time.sleep((int(time.time()) % 5) - 5)
        counter = RollingTimeWindow(key='test_key', cycle_time=.01, window=5)
        counter.setup(self.redis_conn)
        counter.increment()
        counter.increment()
        time.sleep(3)
        counter.increment()
        counter.increment()
        time.sleep(3)
        # at this point the first 2 counts have expired
        counter.increment()
        self.assertEqual(counter.value(), 3)
        time.sleep(5.1)
        # now everything has expired
        self.assertEqual(counter.value(), 0)
        # check to ensure counter is still working
        counter.increment()
        self.assertEqual(counter.value(), 1)
        counter.stop()
        self.clean_keys(counter.key)
dataset/ETHPy150Open istresearch/scrapy-cluster/utils/tests/tests_online.py/TestStatsRollingTimeWindow.test_rolling_window/swapped operands of `-`