Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Statistics Config and Show Commands #3575

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

corrected the failing test case

732612f
Select commit
Loading
Failed to load commit list.
Open

Memory Statistics Config and Show Commands #3575

corrected the failing test case
732612f
Select commit
Loading
Failed to load commit list.
Azure Pipelines / Azure.sonic-utilities failed Oct 28, 2024 in 23m 27s

Build #20241028.21 had test failures

Details

Tests

  • Failed: 249 (7.96%)
  • Passed: 2,875 (91.94%)
  • Other: 3 (0.10%)
  • Total: 3,127

Annotations

Check failure on line 12026 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-utilities

Build log #L12026

Bash exited with code '1'.

Check failure on line 22 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-utilities

Build log #L22

There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.

Check failure on line 1 in test_memory_check_host_not_crossed

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-utilities

test_memory_check_host_not_crossed

AttributeError: 'NoneType' object has no attribute 'get'
Raw output
setup_dbs_regular_mem_usage = None

    def test_memory_check_host_not_crossed(setup_dbs_regular_mem_usage):
        memory_threshold_check.MemoryStats.get_sys_memory_stats = mock.Mock(return_value={'MemAvailable': 1000000, 'MemTotal': 2000000})
>       assert memory_threshold_check.main() == (memory_threshold_check.EXIT_SUCCESS, '')

tests/memory_threshold_check_test.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scripts/memory_threshold_check.py:225: in main
    config = Config(cfg_db)
scripts/memory_threshold_check.py:122: in __init__
    self.memory_available_threshold = self.parse_value_from_db(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

config = None, key = 'available_mem_threshold', converter = <class 'float'>
default = 10

    @staticmethod
    def parse_value_from_db(config, key, converter, default):
>       value = config.get(key)
E       AttributeError: 'NoneType' object has no attribute 'get'

scripts/memory_threshold_check.py:149: AttributeError

Check failure on line 1 in test_memory_check_host_less_then_min_required

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-utilities

test_memory_check_host_less_then_min_required

AttributeError: 'NoneType' object has no attribute 'get'
Raw output
setup_dbs_regular_mem_usage = None

    def test_memory_check_host_less_then_min_required(setup_dbs_regular_mem_usage):
        memory_threshold_check.MemoryStats.get_sys_memory_stats = mock.Mock(return_value={'MemAvailable': 1000, 'MemTotal': 2000000})
>       assert memory_threshold_check.main() == (memory_threshold_check.EXIT_THRESHOLD_CROSSED, '')

tests/memory_threshold_check_test.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scripts/memory_threshold_check.py:225: in main
    config = Config(cfg_db)
scripts/memory_threshold_check.py:122: in __init__
    self.memory_available_threshold = self.parse_value_from_db(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

config = None, key = 'available_mem_threshold', converter = <class 'float'>
default = 10

    @staticmethod
    def parse_value_from_db(config, key, converter, default):
>       value = config.get(key)
E       AttributeError: 'NoneType' object has no attribute 'get'

scripts/memory_threshold_check.py:149: AttributeError

Check failure on line 1 in test_memory_check_host_threshold_crossed

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-utilities

test_memory_check_host_threshold_crossed

AttributeError: 'NoneType' object has no attribute 'get'
Raw output
setup_dbs_regular_mem_usage = None

    def test_memory_check_host_threshold_crossed(setup_dbs_regular_mem_usage):
        memory_threshold_check.MemoryStats.get_sys_memory_stats = mock.Mock(return_value={'MemAvailable': 2000000, 'MemTotal': 20000000})
>       assert memory_threshold_check.main() == (memory_threshold_check.EXIT_THRESHOLD_CROSSED, '')

tests/memory_threshold_check_test.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scripts/memory_threshold_check.py:225: in main
    config = Config(cfg_db)
scripts/memory_threshold_check.py:122: in __init__
    self.memory_available_threshold = self.parse_value_from_db(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

config = None, key = 'available_mem_threshold', converter = <class 'float'>
default = 10

    @staticmethod
    def parse_value_from_db(config, key, converter, default):
>       value = config.get(key)
E       AttributeError: 'NoneType' object has no attribute 'get'

scripts/memory_threshold_check.py:149: AttributeError

Check failure on line 1 in test_memory_check_telemetry_threshold_crossed

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.sonic-utilities

test_memory_check_telemetry_threshold_crossed

AttributeError: 'NoneType' object has no attribute 'get'
Raw output
setup_dbs_telemetry_high_mem_usage = None

    def test_memory_check_telemetry_threshold_crossed(setup_dbs_telemetry_high_mem_usage):
>       assert memory_threshold_check.main() == (memory_threshold_check.EXIT_THRESHOLD_CROSSED, 'telemetry')

tests/memory_threshold_check_test.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scripts/memory_threshold_check.py:225: in main
    config = Config(cfg_db)
scripts/memory_threshold_check.py:122: in __init__
    self.memory_available_threshold = self.parse_value_from_db(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

config = None, key = 'available_mem_threshold', converter = <class 'float'>
default = 10

    @staticmethod
    def parse_value_from_db(config, key, converter, default):
>       value = config.get(key)
E       AttributeError: 'NoneType' object has no attribute 'get'

scripts/memory_threshold_check.py:149: AttributeError