Skip to content

Unittest for the autodetection fails when running on a macbook with the M1 apple chip #2202

@rsarm

Description

@rsarm

The unittest for the autodetection fails when running on a macbook with the M1 apple chip:

================================================================== FAILURES ===================================================================
________________________________________________________________ test_autotect ________________________________________________________________

default_exec_ctx = <unittests.conftest._ExecutionContext object at 0x100852d60>

    def test_autotect(default_exec_ctx):
        autodetect.detect_topology()
        part = runtime().system.partitions[0]
        assert part.processor.info == cpuinfo()
        if part.processor.info:
>           assert part.processor.num_cpus == part.processor.info['num_cpus']
E           KeyError: 'num_cpus'

unittests/test_autodetect.py:77: KeyError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
sysctl: unknown oid 'machdep.cpu.leaf7_features'
sysctl: unknown oid 'machdep.cpu.vendor'
sysctl: unknown oid 'machdep.cpu.model'
sysctl: unknown oid 'machdep.cpu.leaf7_features'
sysctl: unknown oid 'machdep.cpu.vendor'
sysctl: unknown oid 'machdep.cpu.model'
=========================================================== short test summary info ===========================================================
FAILED unittests/test_autodetect.py::test_autotect - KeyError: 'num_cpus'

The command sysctl hw machdep.cpu.cache, which is used in the cpuinfo gives an error:

sysctl: unknown oid 'machdep.cpu.cache'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions