test: misc: up the time limit on the ratelimit tests

I keep hitting this in the gitlab runner, 100ms is clearly not enough here for
slow containers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-07-05 13:55:21 +10:00
parent 2192ec192c
commit b469368790

View file

@ -701,7 +701,7 @@ START_TEST(ratelimit_helpers)
unsigned int i, j;
/* 10 attempts every 100ms */
ratelimit_init(&rl, ms2us(100), 10);
ratelimit_init(&rl, ms2us(500), 10);
for (j = 0; j < 3; ++j) {
/* a burst of 9 attempts must succeed */
@ -723,14 +723,14 @@ START_TEST(ratelimit_helpers)
}
/* ..even after waiting 20ms */
msleep(20);
msleep(100);
for (i = 0; i < 100; ++i) {
ck_assert_int_eq(ratelimit_test(&rl),
RATELIMIT_EXCEEDED);
}
/* but after 100ms the counter is reset */
msleep(90); /* +10ms to account for time drifts */
/* but after 500ms the counter is reset */
msleep(450); /* +50ms to account for time drifts */
}
}
END_TEST