From b8ed133772db6a1529265556178d420ccad8bf5a Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Fri, 31 Mar 2023 07:30:26 -0400 Subject: [PATCH] test: add error match files Narrow test iteration to get proper error log file. Revers logic of test to unblock other tests. Signed-off-by: Tomasz Gromadzki --- src/test/obj_pmalloc_mt/TEST8 | 30 ++++++++++++++---------- src/test/obj_pmalloc_mt/TEST9 | 29 +++++++++++++---------- src/test/obj_pmalloc_mt/err8.log.match | 1 + src/test/obj_pmalloc_mt/err9.log.match | 2 ++ src/test/obj_pmalloc_mt/obj_pmalloc_mt.c | 1 + 5 files changed, 39 insertions(+), 24 deletions(-) create mode 100644 src/test/obj_pmalloc_mt/err8.log.match create mode 100644 src/test/obj_pmalloc_mt/err9.log.match diff --git a/src/test/obj_pmalloc_mt/TEST8 b/src/test/obj_pmalloc_mt/TEST8 index 4a44da67251..9f512e332f4 100755 --- a/src/test/obj_pmalloc_mt/TEST8 +++ b/src/test/obj_pmalloc_mt/TEST8 @@ -9,19 +9,25 @@ . ../unittest/unittest.sh -require_valgrind 3.10 -require_fs_type pmem non-pmem -require_test_type long -configure_valgrind helgrind force-enable +#require_valgrind 3.10 +require_fs_type pmem +require_test_type short +#configure_valgrind helgrind force-enable setup -for n in {1..500} -do - if test -f "rm $DIR/testfile"; then - rm $DIR/testfile - fi - PMEM_IS_PMEM_FORCE=1 expect_normal_exit\ - ./obj_pmalloc_mt$EXESUFFIX 32 1000 100 $DIR/testfile 1 $n -done +if test -f "rm $DIR/testfile"; then + rm $DIR/testfile +fi +PMEM_IS_PMEM_FORCE=1 expect_normal_exit\ + ./obj_pmalloc_mt$EXESUFFIX 32 1000 100 $DIR/testfile 1 0 + +if test -f "rm $DIR/testfile"; then + rm $DIR/testfile +fi + +PMEM_IS_PMEM_FORCE=1 expect_abnormal_exit\ + ./obj_pmalloc_mt$EXESUFFIX 32 1000 100 $DIR/testfile 1 1 + +check pass diff --git a/src/test/obj_pmalloc_mt/TEST9 b/src/test/obj_pmalloc_mt/TEST9 index 8f259cdac7e..1db855e3249 100755 --- a/src/test/obj_pmalloc_mt/TEST9 +++ b/src/test/obj_pmalloc_mt/TEST9 @@ -9,19 +9,24 @@ . ../unittest/unittest.sh -require_valgrind 3.10 -require_fs_type pmem non-pmem -require_test_type long -configure_valgrind helgrind force-enable +#require_valgrind 3.10 +require_fs_type pmem +require_test_type short +#configure_valgrind helgrind force-enable setup -for n in {1..50} -do - if test -f "rm $DIR/testfile"; then - rm $DIR/testfile - fi - PMEM_IS_PMEM_FORCE=1 expect_normal_exit\ - ./obj_pmalloc_mt$EXESUFFIX 32 1000 100 $DIR/testfile 0 $n -done +if test -f "rm $DIR/testfile"; then + rm $DIR/testfile +fi +PMEM_IS_PMEM_FORCE=1 expect_normal_exit\ + ./obj_pmalloc_mt$EXESUFFIX 32 1000 100 $DIR/testfile 0 0 + +if test -f "rm $DIR/testfile"; then + rm $DIR/testfile +fi +PMEM_IS_PMEM_FORCE=1 expect_abnormal_exit\ + ./obj_pmalloc_mt$EXESUFFIX 32 1000 100 $DIR/testfile 0 1 + +check pass diff --git a/src/test/obj_pmalloc_mt/err8.log.match b/src/test/obj_pmalloc_mt/err8.log.match new file mode 100644 index 00000000000..2f6920d5025 --- /dev/null +++ b/src/test/obj_pmalloc_mt/err8.log.match @@ -0,0 +1 @@ +{obj_pmalloc_mt.c:68 realloc_worker} obj_pmalloc_mt/TEST8: Error: assertion failure: ret (0xffffffffffffffff) == 0 (0x0) diff --git a/src/test/obj_pmalloc_mt/err9.log.match b/src/test/obj_pmalloc_mt/err9.log.match new file mode 100644 index 00000000000..80b4f9f19a9 --- /dev/null +++ b/src/test/obj_pmalloc_mt/err9.log.match @@ -0,0 +1,2 @@ +{obj_pmalloc_mt.c:68 realloc_worker} obj_pmalloc_mt/TEST9: Error: assertion failure: ret (0xffffffffffffffff) == 0 (0x0) +{obj_pmalloc_mt.c:68 realloc_worker} obj_pmalloc_mt/TEST9: Error: assertion failure: ret (0xffffffffffffffff) == 0 (0x0) diff --git a/src/test/obj_pmalloc_mt/obj_pmalloc_mt.c b/src/test/obj_pmalloc_mt/obj_pmalloc_mt.c index d23e4d1d5f4..9fd916ac4d1 100644 --- a/src/test/obj_pmalloc_mt/obj_pmalloc_mt.c +++ b/src/test/obj_pmalloc_mt/obj_pmalloc_mt.c @@ -465,6 +465,7 @@ main(int argc, char *argv[]) */ if (Threads == MAX_THREADS) /* don't run for short tests */ run_worker(tx_worker, args); + run_worker(tx3_worker, args); pmemobj_close(pop);