Skip to content

Commit

Permalink
Merge pull request #5817 from osalyk/obj_sync_valgrind
Browse files Browse the repository at this point in the history
test: add a test that checks performance without valgrind
  • Loading branch information
janekmi authored Jul 21, 2023
2 parents b3e60ae + 71d8e52 commit 1015c35
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
35 changes: 28 additions & 7 deletions src/test/obj_sync/TEST0
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
# Copyright 2015-2023, Intel Corporation

#
# src/test/obj_sync/TEST0 -- unit test for PMEM-resident locks
# src/test/obj_sync/TEST0 -- unit test for PMEM-resident locks without valgrind
#

. ../unittest/unittest.sh
# Test cases "m", "r", "c" fail under valgrind.
# This test verifies that the tests run normally
# until these errors are fixed: https://github.com/pmem/pmdk/issues/5646
# and https://github.com/pmem/pmdk/issues/5727

# XXX disable the test until https://github.com/pmem/pmdk/issues/5727
# and https://github.com/pmem/pmdk/issues/5643 are fixed.
DISABLED
. ../unittest/unittest.sh

require_test_type medium

Expand All @@ -19,8 +20,28 @@ require_build_type debug nondebug

setup

expect_normal_exit ./obj_sync$EXESUFFIX m 50 5

LOG=out${UNITTEST_NUM}.log
LOG_TEMP=out${UNITTEST_NUM}_part.log
ERR=err${UNITTEST_NUM}.log
ERR_TEMP=err${UNITTEST_NUM}_part.log

rm -f $LOG $LOG_TEMP $ERR $ERR_TEMP

VALGRIND_DISABLED=y expect_normal_exit ./obj_sync$EXESUFFIX m 50 5
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
VALGRIND_DISABLED=y expect_normal_exit ./obj_sync$EXESUFFIX r 50 5
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
VALGRIND_DISABLED=y expect_normal_exit ./obj_sync$EXESUFFIX c 50 5
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
VALGRIND_DISABLED=y expect_normal_exit ./obj_sync$EXESUFFIX t 50 5
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

mv $LOG_TEMP $LOG
mv $ERR_TEMP $ERR
check

pass
3 changes: 3 additions & 0 deletions src/test/obj_sync/err0.log.match
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{$(nW)obj_sync.c:$(N) mutex_$(nW)_worker} obj_sync$(nW)TEST0: pmemobj_mutex_lock
{$(nW)obj_sync.c:$(N) rwlock_$(nW)_worker} obj_sync$(nW)TEST0: pmemobj_rwlock_wrlock
{$(nW)obj_sync.c:$(N) cond_$(nW)_worker} obj_sync$(nW)TEST0: pmemobj_cond_signal
{$(nW)obj_sync.c:$(N) timed_$(nW)_worker} obj_sync$(nW)TEST0: pmemobj_mutex_timedlock: Invalid argument
9 changes: 9 additions & 0 deletions src/test/obj_sync/out0.log.match
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
obj_sync$(nW)TEST0: START: obj_sync
$(nW)obj_sync$(nW) $(nW) $(N) $(N)
obj_sync$(nW)TEST0: DONE
obj_sync$(nW)TEST0: START: obj_sync
$(nW)obj_sync$(nW) $(nW) $(N) $(N)
obj_sync$(nW)TEST0: DONE
obj_sync$(nW)TEST0: START: obj_sync
$(nW)obj_sync$(nW) $(nW) $(N) $(N)
obj_sync$(nW)TEST0: DONE
obj_sync$(nW)TEST0: START: obj_sync
$(nW)obj_sync$(nW) $(nW) $(N) $(N)
obj_sync$(nW)TEST0: DONE

0 comments on commit 1015c35

Please sign in to comment.