Dasharo / open-source-firmware-validation

OSFV infrastructure with automated tests and scripts for managing test results
Apache License 2.0
8 stars 1 forks source link

CPF stress-test-windows script issues #480

Open philipandag opened 3 weeks ago

philipandag commented 3 weeks ago

Device

V560TND

RTE version

--

OSFV version

v560tne-v0.9.1-rc3-testing-fixes

Affected component(s) or functionality

CPF cpu frequency tests under load on Windows

Brief summary

The script is not run automatically, when run manually only uses 4 cores and ends early which is hardcoded

How reproducible

100% on this device and branch

How to reproduce

Run a test like CPF-004.004, check the CPU usage, check che stress-test-windows.ps1 script code

Expected behavior

The cpu should run at ~100% during the whole test

Actual behavior

The clock measurements don't start until the load ends. Then the cpu is running at ~1% usage. Running the script manually does stress the 4 hard-coded cores which results in ~25% usage on this device for about a minute. Even after increasing the hardcoded core count the cpu usage in task manager rises to at most ~60%.

Link to screenshots or logs

$numCores = 4 # <-- Only 4 cores, should not be hardcoded but determined on per-device basis

foreach ($loopnumber in 1..$numCores){
    Start-Job -ScriptBlock{
    $result = 1
        foreach ($number in 1..40000000){   # <-- Ends after 40mln iterations which takes about a minute, the length of the test
            $result = $result * $number           # should not depend on how fast is the DUT
        }
    }
}

Wait-Job *
Clear-Host
Receive-Job *
Remove-Job *

Additional context

Maybe there is some reliable tool we could use instead of writing a stress script

Solutions you've tried

Increasing number of workers and iterations, running the script manually

philipandag commented 4 days ago

I have tried to make the jobs time-bound and to get the core count dynamically:

$numCores = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors

foreach ($loopnumber in 1..$numCores){
    $end_time = (Get-Date).AddMinutes(60) # Parametrize stress length
    Start-Job -ScriptBlock{
        $result = 7
        while ((Get-Date) -lt ($end_time)){
            # Is this really the best operation to stress the system?
            $result = $result * $result
        }
    }
}

Wait-Job *
Clear-Host
Receive-Job *
Remove-Job *

This script does not work as well. The core count is ok but the jobs still stop after a couple seconds.