X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_stats_client.py;h=e5b6aa793869126a9678c6539bb491b2500be110;hb=d70777aa60a87001f323f3b226d7e5cee2cd23d8;hp=7e17e2a1fddbcfc3ef133f80433a1e7a30cfd13f;hpb=5ab7dc45b5c4a1dbe7bff65fd9864b1c9ebb8640;p=vpp.git diff --git a/test/test_stats_client.py b/test/test_stats_client.py index 7e17e2a1fdd..e5b6aa79386 100644 --- a/test/test_stats_client.py +++ b/test/test_stats_client.py @@ -2,6 +2,8 @@ import unittest import psutil +import sys +import six from vpp_papi.vpp_stats import VPPStats from framework import tag_fixme_vpp_workers @@ -108,7 +110,19 @@ class StatsClientTestCase(VppTestCase): # We wait for nodes symlinks to update (interfaces created/deleted). # ... and packets to be sent self.sleep(0.1) - vectors = self.statistics.get_counter('/nodes/pg1-tx/vectors') + for _ in range(5): + try: + vectors = self.statistics.get_counter('/nodes/pg1-tx/vectors') + if vectors[0] == 0: + raise ValueError("Nodes counters are not up to date") + break + except: + t, v, tb = sys.exc_info() + + self.sleep(0.1) + continue + else: + six.reraise(t, v, tb) self.assertEqual(tx[0]['bytes'] - tx_before_sending[0]['bytes'], bytes_to_send)