[MERGED] libosmocore[master]: bssgp_fc_test: do not use real time

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Feb 7 00:39:55 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: bssgp_fc_test: do not use real time
......................................................................


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
---
M tests/gb/bssgp_fc_test.c
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/gb/bssgp_fc_test.c b/tests/gb/bssgp_fc_test.c
index d77f141..27d8fcc 100644
--- a/tests/gb/bssgp_fc_test.c
+++ b/tests/gb/bssgp_fc_test.c
@@ -70,6 +70,12 @@
 	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 @@
 	}
 
 	while (1) {
-		usleep(100000);
+		osmo_gettimeofday_override_add(0, 100000);
+
 		osmo_timers_check();
 		osmo_timers_prepare();
 		osmo_timers_update();

-- 
To view, visit https://gerrit.osmocom.org/1760
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5029b85c2a154554d75d7f9af49a3b93425fdd9
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list