Skip to content

Commit

Permalink
test: add a test that checks performance without valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
osalyk committed Jul 21, 2023
1 parent b3e60ae commit bba16f6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
36 changes: 29 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,29 @@ 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 && touch $LOG
rm -f $LOG_TEMP && touch $LOG_TEMP

VALGRIND_DISABLED=y expect_normal_exit ./obj_sync$EXESUFFIX m 10 5
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
VALGRIND_DISABLED=y expect_normal_exit ./obj_sync$EXESUFFIX r 10 5
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
VALGRIND_DISABLED=y expect_normal_exit ./obj_sync$EXESUFFIX c 10 5
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
VALGRIND_DISABLED=y expect_normal_exit ./obj_sync$EXESUFFIX t 10 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 bba16f6

Please sign in to comment.