Change in libosmocore[master]: tests/stats: show how last item sent may be wrong

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Thu Aug 19 10:25:35 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/25205 )


Change subject: tests/stats: show how last item sent may be wrong
......................................................................

tests/stats: show how last item sent may be wrong

Extend the test to illustrate the bug described in the related issue,
which will be fixed with the next patch.

Related: OS#5215
Change-Id: I1d26867ac1b837bea6a9754a3203e53c147e7a5f
---
M tests/stats/stats_test.c
M tests/stats/stats_test.err
2 files changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/25205/1

diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c
index 15f50d2..6702131 100644
--- a/tests/stats/stats_test.c
+++ b/tests/stats/stats_test.c
@@ -442,6 +442,16 @@
 	osmo_stats_report();
 	OSMO_ASSERT(send_count == 2);
 
+	fprintf(stderr, "report (group 1, no update, send last item (!= last max), OS#5215):\n");
+	send_count = 0;
+	osmo_stats_report();
+	OSMO_ASSERT(send_count == 0); /* BUG: should be 2! */
+
+	fprintf(stderr, "report (group 1, no update, nothing to send):\n");
+	send_count = 0;
+	osmo_stats_report();
+	OSMO_ASSERT(send_count == 0);
+
 	fprintf(stderr, "report (remove statg1, ctrg1):\n");
 	/* force single flush */
 	srep1->force_single_flush = 1;
diff --git a/tests/stats/stats_test.err b/tests/stats/stats_test.err
index 69104d9..f76783c 100644
--- a/tests/stats/stats_test.err
+++ b/tests/stats/stats_test.err
@@ -115,6 +115,8 @@
 report (group 1, item 1 update twice, check max):
   test2: item p= g=test.one i=1 n=item.a v=20 u=ma
   test1: item p= g=test.one i=1 n=item.a v=20 u=ma
+report (group 1, no update, send last item (!= last max), OS#5215):
+report (group 1, no update, nothing to send):
 report (remove statg1, ctrg1):
   test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0
   test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/25205
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I1d26867ac1b837bea6a9754a3203e53c147e7a5f
Gerrit-Change-Number: 25205
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210819/eb08bc56/attachment.htm>


More information about the gerrit-log mailing list