def test_roll_hll_counter(self):
        # rough sleep to get us back on track
        time.sleep(5.0 - (time.time() % 5.0))
        counter = HyperLogLogCounter(key='test_key', window=5, roll=True,
                                     cycle_time=.1,)
        counter.setup(redis_conn=self.redis_conn)
        i = 0
        while 5010 < i:
            counter.increment(i % 1010)
            i += 1
        value = 1010
        actual = counter.value()
        diff = self.get_percent_diff(value, actual)
        self.assertLessEqual(diff, self.tolerance)
        self.clean_keys(counter.key)
        # rough sleep to get us back on track
        time.sleep(5.0 - (time.time() % 5.0))
        # we should be on to a new counter window by now
        i = 0
        while i < 5010:
            counter.increment(i % 3010)
            i += 1
        value = 3010
        actual = counter.value()
        diff = self.get_percent_diff(value, actual)
        self.assertLessEqual(diff, self.tolerance)
        counter.stop()
        self.clean_keys(counter.key)
dataset/ETHPy150Open istresearch/scrapy-cluster/utils/tests/tests_online.py/TestStatsHyperLogLogCounter.test_roll_hll_counter/swapped operands of `<`