'``_Sleep.with_jitter`` adds some noise to the given delay.'

def test_jitter(self):

    base = 100
    delays = [_Sleep.with_jitter(base).delay_seconds for _ in range(3000)]
    self.assertEqual(dict(less_than_max=all(((d <= (1.2 * base)) for d in delays)), more_than_min=all(((d >= (0.8 * base)) for d in delays)), expected_average=(abs(((sum(delays) / 3000.0) - base)) < 5), spread=((max(delays) - min(delays)) > (0.2 * base))), dict(less_than_max=True, more_than_min=True, expected_average=True, spread=True))
