aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2021-08-19 10:07:44 +0200
committerosmith <osmith@sysmocom.de>2021-08-20 14:04:54 +0000
commita79a549273de9fbd014f2602ebe1885d308e531e (patch)
treed87c19b6d7284319ad731b731dc2abae99c77cbb
parent22db07d7ede575411a41c05173f93cf1e0106522 (diff)
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
-rw-r--r--tests/stats/stats_test.c10
-rw-r--r--tests/stats/stats_test.err2
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c
index 15f50d22..6505e669 100644
--- a/tests/stats/stats_test.c
+++ b/tests/stats/stats_test.c
@@ -442,6 +442,16 @@ static void test_reporting()
osmo_stats_report();
OSMO_ASSERT(send_count == 2);
+ fprintf(stderr, "report (group 1, item 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, item 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 69104d9c..08c2cbcd 100644
--- a/tests/stats/stats_test.err
+++ b/tests/stats/stats_test.err
@@ -115,6 +115,8 @@ report (group 1, item 1 update twice):
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, item 1 no update, send last item (!= last max), OS#5215):
+report (group 1, item 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