Skip to content

Fix the cpu_shares test

Denis Pynkin requested to merge wip/d4s/T5855 into apertis/v2019

Used stress test (for ~30minutes) for this patch without hangs anymore:

while true; do common/run-test-in-systemd --name=cpu-shares --timeout=900 env DEBUG=2 ./cgroups-resource-control.sh test_cpu_shares ; done
``

With a lot of background processes with intense CPU usage races may
occur -- due usage of global variable which for keeping all child PIDs
sometimes the process which is parent for `burnBX` is killed before it
is able to kill `burnBX`. So CPU burning processes left and test can't
be completed since it is waiting for all child processes to be killed
prior to proceed to exit.

Using local PIDs list per background process allows test to be more
predictable and avoid races.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>

Merge request reports