From 5320be99d744b45af9262ecfca84df444b9a5097 Mon Sep 17 00:00:00 2001 From: Veronica Cojocaru Date: Fri, 13 Dec 2024 18:46:20 +0000 Subject: [PATCH] Fix laganalyzer error in test_iface_namingmode Similar issue to https://github.com/sonic-net/sonic-mgmt/pull/12174 in that counters stats continue to be polled in an unstable state. In the test_iface_namingmode.py case, TestConfigInterface resets the interface configurations at the end, and these syslog errors only appear after the test begins the teardown process. Adding a loganalyzer ignore for this message to this test to fix. --- tests/iface_namingmode/test_iface_namingmode.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/iface_namingmode/test_iface_namingmode.py b/tests/iface_namingmode/test_iface_namingmode.py index fb23aaecae0..c884aa29cfe 100644 --- a/tests/iface_namingmode/test_iface_namingmode.py +++ b/tests/iface_namingmode/test_iface_namingmode.py @@ -26,6 +26,16 @@ def skip_test_for_multi_asic(duthosts, enum_rand_one_per_hwsku_frontend_hostname pytest.skip('CLI command not supported') +@pytest.fixture(autouse=True) +def ignore_expected_loganalyzer_exception(duthosts, enum_rand_one_per_hwsku_frontend_hostname, loganalyzer): + if loganalyzer: + ignore_regex_list = [ + ".* ERR syncd#syncd: :- collectData: Failed to get stats of Port Counter.*" + ] + duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname] + loganalyzer[duthost.hostname].ignore_regex.extend(ignore_regex_list) + + @pytest.fixture(scope='module', autouse=True) def setup(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo): """