Skip to content

Run DAX and multi-NUMA tests under valgrind #1006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/reusable_dax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ env:
INSTL_DIR : "${{github.workspace}}/../install-dir"
COVERAGE_DIR : "${{github.workspace}}/coverage"
COVERAGE_NAME : "exports-coverage-dax"
DAX_TESTS: "./test/umf_test-provider_file_memory ./test/umf_test-provider_devdax_memory"

jobs:
dax:
Expand Down Expand Up @@ -126,6 +127,12 @@ jobs:
UMF_TESTS_FSDAX_PATH_2=${{env.UMF_TESTS_FSDAX_PATH_2}}
ctest -C ${{matrix.build_type}} -V -R "file|fsdax"

- name: Run DAX tests under valgrind
run: |
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} memcheck "${{env.DAX_TESTS}}"
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} drd "${{env.DAX_TESTS}}"
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} helgrind "${{env.DAX_TESTS}}"

- name: Check coverage
if: ${{ matrix.build_type == 'Debug' }}
working-directory: ${{env.BUILD_DIR}}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/reusable_multi_numa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
BUILD_DIR : "${{github.workspace}}/build"
COVERAGE_DIR : "${{github.workspace}}/coverage"
COVERAGE_NAME : "exports-coverage-multinuma"
NUMA_TESTS: "./test/umf_test-memspace_numa ./test/umf_test-provider_os_memory_multiple_numa_nodes"

jobs:
multi_numa:
Expand Down Expand Up @@ -68,6 +69,13 @@ jobs:
./test/umf_test-provider_os_memory_multiple_numa_nodes \
--gtest_filter="-*checkModeLocal/*:*checkModePreferredEmptyNodeset/*:testNuma.checkModeInterleave"

- name: Run NUMA tests under valgrind
if: matrix.os != 'rhel-9.1'
run: |
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} memcheck "${{env.NUMA_TESTS}}"
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} drd "${{env.NUMA_TESTS}}"
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} helgrind "${{env.NUMA_TESTS}}"

- name: Check coverage
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'ubuntu-22.04' }}
working-directory: ${{env.BUILD_DIR}}
Expand Down
22 changes: 17 additions & 5 deletions test/test_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ set -e
WORKSPACE=$1
BUILD_DIR=$2
TOOL=$3
TESTS=$4

function print_usage() {
echo "$(basename $0) - run all UMF tests and examples under a valgrind tool (memcheck, drd or helgrind)"
echo "This script looks for './test/umf_test-*' and './examples/umf_example_*' executables in the UMF build directory."
echo "Usage: $(basename $0) <workspace_dir> <build_dir> <memcheck|drd|helgrind>"
echo "$(basename $0) - run UMF tests and examples under a valgrind tool (memcheck, drd or helgrind)"
echo "Usage: $(basename $0) <workspace_dir> <build_dir> <memcheck|drd|helgrind> [tests_examples]"
echo "Where:"
echo
echo "tests_examples - (optional) list of tests or examples to be run (paths relative to the <build_dir> build directory)."
echo " If it is empty, all tests (./test/umf_test-*) and examples (./examples/umf_example_*)"
echo " found in <build_dir> will be run."
}

if ! valgrind --version > /dev/null; then
Expand Down Expand Up @@ -62,7 +67,7 @@ cd ${BUILD_DIR}
mkdir -p cpuid

echo "Gathering data for hwloc so it can be run under valgrind:"
hwloc-gather-cpuid ./cpuid
hwloc-gather-cpuid ./cpuid >/dev/null

echo
echo "Working directory: $(pwd)"
Expand All @@ -71,7 +76,14 @@ echo "Running: \"valgrind $OPTION\" for the following tests:"
ANY_TEST_FAILED=0
rm -f umf_test-*.log umf_test-*.err

for test in $(ls -1 ./test/umf_test-* ./examples/umf_example_*); do
[ "$TESTS" = "" ] && TESTS=$(ls -1 ./test/umf_test-* ./examples/umf_example_*)

for test in $TESTS; do
if [ ! -f $test ]; then
echo
echo "error: the $test (${BUILD_DIR}/$test) file does not exist"
exit 1
fi
[ ! -x $test ] && continue
echo "$test - starting ..."
echo -n "$test "
Expand Down
Loading