summaryrefslogtreecommitdiffstats
path: root/tests/gb
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-06 14:39:53 +0100
committerHarald Welte <laforge@gnumonks.org>2017-02-07 00:39:54 +0000
commit7132011afa1741f8cc435250a6981a4f6919f396 (patch)
treecb2c0fba5e08920a395b4302916684d830002e0f /tests/gb
parent03ab9a650068c758c1102f074606a747827583a8 (diff)
bssgp_fc_test: do not use real time
Employ osmo_gettimeofday_override_* to take bssgp_fc_test off real time. The jenkins build slave often failed the test based on sporadic time delays due to server load and randomly rejected good patches. This patch ends that. Change-Id: Ie5029b85c2a154554d75d7f9af49a3b93425fdd9 Related: OS#1809
Diffstat (limited to 'tests/gb')
-rw-r--r--tests/gb/bssgp_fc_test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/gb/bssgp_fc_test.c b/tests/gb/bssgp_fc_test.c
index d77f141a..27d8fcc1 100644
--- a/tests/gb/bssgp_fc_test.c
+++ b/tests/gb/bssgp_fc_test.c
@@ -70,6 +70,12 @@ static void test_fc(uint32_t bucket_size_max, uint32_t bucket_leak_rate,
struct bssgp_flow_control *fc = talloc_zero(NULL, struct bssgp_flow_control);
int i;
+ osmo_gettimeofday_override_time = (struct timeval){
+ .tv_sec = 1486385000,
+ .tv_usec = 423423,
+ };
+ osmo_gettimeofday_override = true;
+
bssgp_fc_init(fc, bucket_size_max, bucket_leak_rate, max_queue_depth,
fc_out_cb);
@@ -83,7 +89,8 @@ static void test_fc(uint32_t bucket_size_max, uint32_t bucket_leak_rate,
}
while (1) {
- usleep(100000);
+ osmo_gettimeofday_override_add(0, 100000);
+
osmo_timers_check();
osmo_timers_prepare();
osmo_timers_update();