]> code.ossystems Code Review - openembedded-core.git/commit
valgrind: Improve non-deterministic ptest reliability
authorTony Tascioglu <tony.tascioglu@windriver.com>
Fri, 4 Jun 2021 14:07:56 +0000 (10:07 -0400)
committerAnuj Mittal <anuj.mittal@intel.com>
Thu, 10 Jun 2021 06:56:06 +0000 (14:56 +0800)
commit79ec1d73a107277586d3d8e9c0d46dfc0ac2b0d8
treef0d8078afa7a38c0a9a6a7f774e0c2ae98240e2f
parentd68c62bb93ab400878aecc42ee06df103356a2bf
valgrind: Improve non-deterministic ptest reliability

Several of the valgrind tests (particulaly helgrind) are unreliable and
can fail with a different output.

Particularly, there is a higher chance of failure on QEMU instances with
SMP enabled and on systems with more interrupts such as laptops on powersave.

The tests have been reported upstream as being unreliable dating back
over 5 years, due in part to the ordering of threads during
an "unwinding" process in helgrind.
https://bugs.kde.org/show_bug.cgi?id=345121
https://bugs.kde.org/show_bug.cgi?id=430321

A workaround to improve the reliability of such tests is to force them
to run on a single CPU core using taskset. This greatly reduces the
chance of a failure.

>From my testing, I have found it can help reduce the rate of failures
on both a laptop and QEMU by over 5x. Stress-testing in QEMU for several
hours did not result in a failure while running the test normally did.

The flaky or undeterministic thread-based tests are defined in the
taskset_nondeterministic_tests file. These test cases will be run with
taskset 0x00000001 to run on a single CPU core rather then the regular
test.

The edited run-ptest executes the flaky tests first, then ignores them
to not duplicate the results from the main tests. Everything modified is
restored when testing is complete.

The drawback is that this isn't a foolproof solution. It helps the tests
fail much less frequently, and considering how this issue has been documented
for a long time, a workaround such as this is needed.

Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b318944dd72ca7b0408e955f3599381ab3ac3ba8)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/recipes-devtools/valgrind/valgrind/run-ptest
meta/recipes-devtools/valgrind/valgrind/taskset_nondeterministic_tests [new file with mode: 0644]