• Kirill Smelkov's avatar
    neotest: info-local: Fix it when CPU frequence/idle information is not available · 3c2b7d3d
    Kirill Smelkov authored
    For example under KVM it was failing as
    
        cpu:	Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz
        cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq: No such file or directory
          File "<string>", line 1
            print '%.2fGHz' % ( / 1E6)
                                ^
        SyntaxError: invalid syntax
    
        $ lscpu
        Architecture:        x86_64
        CPU op-mode(s):      32-bit, 64-bit
        Byte Order:          Little Endian
        Address sizes:       40 bits physical, 48 bits virtual
        CPU(s):              40
        On-line CPU(s) list: 0-39
        Thread(s) per core:  1
        Core(s) per socket:  1
        Socket(s):           40
        NUMA node(s):        1
        Vendor ID:           GenuineIntel
        CPU family:          6
        Model:               63
        Model name:          Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz
        Stepping:            2
        CPU MHz:             2494.238
        BogoMIPS:            4988.47
        Virtualization:      VT-x
        Hypervisor vendor:   KVM
        Virtualization type: full
        L1d cache:           32K
        L1i cache:           32K
        L2 cache:            4096K
        L3 cache:            16384K
        NUMA node0 CPU(s):   0-39
        Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single pti tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat
    
    -> Fix it by checking whether cpufreq/cpuidle directories are available, and display "?" if they are not.
    3c2b7d3d
neotest 40.3 KB