Commit d2f47638 authored by unknown's avatar unknown

Small changes for unit tests.


storage/maria/unittest/Makefile.am:
  fixed names of tests.
storage/maria/unittest/ma_pagecache_consist.c:
  Some of pagecache multi-thread tests are not big.
  Fixed reporting of tests end (now under mutex protection).
storage/maria/unittest/ma_test_loghandler-t.c:
  fixed layout to make blocks nof parameters more visible.
parent 4d1cb991
...@@ -29,20 +29,20 @@ LDADD= $(top_builddir)/unittest/mytap/libmytap.a \ ...@@ -29,20 +29,20 @@ LDADD= $(top_builddir)/unittest/mytap/libmytap.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@ $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
noinst_PROGRAMS = ma_control_file-t trnman-t lockman2-t \ noinst_PROGRAMS = ma_control_file-t trnman-t lockman2-t \
ma_pagecache_single_1k-t ma_pagecache_single_8k-t \ ma_pagecache_single_1k-t ma_pagecache_single_8k-t \
ma_pagecache_single_64k_big-t \ ma_pagecache_single_64k-t \
ma_pagecache_consist_1k_big-t \ ma_pagecache_consist_1k-t \
ma_pagecache_consist_64k_big-t \ ma_pagecache_consist_64k-t \
ma_pagecache_consist_1kHC_big-t \ ma_pagecache_consist_1kHC-t \
ma_pagecache_consist_64kHC_big-t \ ma_pagecache_consist_64kHC-t \
ma_pagecache_consist_1kRD_big-t \ ma_pagecache_consist_1kRD-t \
ma_pagecache_consist_64kRD_big-t \ ma_pagecache_consist_64kRD-t \
ma_pagecache_consist_1kWR_big-t \ ma_pagecache_consist_1kWR-t \
ma_pagecache_consist_64kWR_big-t \ ma_pagecache_consist_64kWR-t \
ma_test_loghandler-t \ ma_test_loghandler-t \
ma_test_loghandler_multigroup-t \ ma_test_loghandler_multigroup-t \
ma_test_loghandler_multithread-t \ ma_test_loghandler_multithread-t \
ma_test_loghandler_pagecache-t \ ma_test_loghandler_pagecache-t \
ma_test_loghandler_long_big-t \ ma_test_loghandler_long-t \
ma_test_loghandler_noflush-t \ ma_test_loghandler_noflush-t \
ma_test_loghandler_first_lsn-t \ ma_test_loghandler_first_lsn-t \
ma_test_loghandler_max_lsn-t \ ma_test_loghandler_max_lsn-t \
...@@ -54,8 +54,8 @@ ma_test_loghandler_t_SOURCES = ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_ ...@@ -54,8 +54,8 @@ ma_test_loghandler_t_SOURCES = ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_
ma_test_loghandler_multigroup_t_SOURCES = ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c ma_test_loghandler_multigroup_t_SOURCES = ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_multithread_t_SOURCES = ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c ma_test_loghandler_multithread_t_SOURCES = ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_pagecache_t_SOURCES = ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c ma_test_loghandler_pagecache_t_SOURCES = ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_long_big_t_SOURCES = ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c ma_test_loghandler_long_t_SOURCES = ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_long_big_t_CPPFLAGS = -DLONG_LOG_TEST ma_test_loghandler_long_t_CPPFLAGS = -DLONG_LOG_TEST
ma_test_loghandler_noflush_t_SOURCES = ma_test_loghandler_noflush-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c ma_test_loghandler_noflush_t_SOURCES = ma_test_loghandler_noflush-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_first_lsn_t_SOURCES = ma_test_loghandler_first_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c ma_test_loghandler_first_lsn_t_SOURCES = ma_test_loghandler_first_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_max_lsn_t_SOURCES = ma_test_loghandler_max_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c ma_test_loghandler_max_lsn_t_SOURCES = ma_test_loghandler_max_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
...@@ -70,30 +70,30 @@ ma_pagecache_common_cppflags = -DEXTRA_DEBUG -DPAGECACHE_DEBUG -DMAIN ...@@ -70,30 +70,30 @@ ma_pagecache_common_cppflags = -DEXTRA_DEBUG -DPAGECACHE_DEBUG -DMAIN
ma_pagecache_single_1k_t_SOURCES = $(ma_pagecache_single_src) ma_pagecache_single_1k_t_SOURCES = $(ma_pagecache_single_src)
ma_pagecache_single_8k_t_SOURCES = $(ma_pagecache_single_src) ma_pagecache_single_8k_t_SOURCES = $(ma_pagecache_single_src)
ma_pagecache_single_64k_big_t_SOURCES = $(ma_pagecache_single_src) ma_pagecache_single_64k_t_SOURCES = $(ma_pagecache_single_src)
ma_pagecache_single_1k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 ma_pagecache_single_1k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024
ma_pagecache_single_8k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=8192 ma_pagecache_single_8k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=8192
ma_pagecache_single_64k_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DBIG ma_pagecache_single_64k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DBIG
ma_pagecache_consist_1k_big_t_SOURCES = $(ma_pagecache_consist_src) ma_pagecache_consist_1k_t_SOURCES = $(ma_pagecache_consist_src)
ma_pagecache_consist_1k_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 ma_pagecache_consist_1k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024
ma_pagecache_consist_64k_big_t_SOURCES = $(ma_pagecache_consist_src) ma_pagecache_consist_64k_t_SOURCES = $(ma_pagecache_consist_src)
ma_pagecache_consist_64k_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 ma_pagecache_consist_64k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536
ma_pagecache_consist_1kHC_big_t_SOURCES = $(ma_pagecache_consist_src) ma_pagecache_consist_1kHC_t_SOURCES = $(ma_pagecache_consist_src)
ma_pagecache_consist_1kHC_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_HIGH_CONCURENCY ma_pagecache_consist_1kHC_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_HIGH_CONCURENCY
ma_pagecache_consist_64kHC_big_t_SOURCES = $(ma_pagecache_consist_src) ma_pagecache_consist_64kHC_t_SOURCES = $(ma_pagecache_consist_src)
ma_pagecache_consist_64kHC_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_HIGH_CONCURENCY ma_pagecache_consist_64kHC_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_HIGH_CONCURENCY
ma_pagecache_consist_1kRD_big_t_SOURCES = $(ma_pagecache_consist_src) ma_pagecache_consist_1kRD_t_SOURCES = $(ma_pagecache_consist_src)
ma_pagecache_consist_1kRD_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_READERS ma_pagecache_consist_1kRD_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_READERS
ma_pagecache_consist_64kRD_big_t_SOURCES = $(ma_pagecache_consist_src) ma_pagecache_consist_64kRD_t_SOURCES = $(ma_pagecache_consist_src)
ma_pagecache_consist_64kRD_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_READERS ma_pagecache_consist_64kRD_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_READERS
ma_pagecache_consist_1kWR_big_t_SOURCES = $(ma_pagecache_consist_src) ma_pagecache_consist_1kWR_t_SOURCES = $(ma_pagecache_consist_src)
ma_pagecache_consist_1kWR_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_WRITERS ma_pagecache_consist_1kWR_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_WRITERS
ma_pagecache_consist_64kWR_big_t_SOURCES = $(ma_pagecache_consist_src) ma_pagecache_consist_64kWR_t_SOURCES = $(ma_pagecache_consist_src)
ma_pagecache_consist_64kWR_big_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_WRITERS ma_pagecache_consist_64kWR_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_WRITERS
# the generic lock manager may not be used in the end and lockman1-t crashes, # the generic lock manager may not be used in the end and lockman1-t crashes,
# so we don't build lockman-t and lockman1-t # so we don't build lockman-t and lockman1-t
......
...@@ -37,6 +37,8 @@ static uint number_of_tests= 30000; ...@@ -37,6 +37,8 @@ static uint number_of_tests= 30000;
static uint record_length_limit= PAGE_SIZE/200; static uint record_length_limit= PAGE_SIZE/200;
static uint number_of_pages= 20; static uint number_of_pages= 20;
static uint flush_divider= 1000; static uint flush_divider= 1000;
#undef SKIP_BIG_TESTS
#define SKIP_BIG_TESTS(X) /* no-op */
#else /*TEST_READERS*/ #else /*TEST_READERS*/
#ifdef TEST_WRITERS #ifdef TEST_WRITERS
static uint number_of_readers= 0; static uint number_of_readers= 0;
...@@ -45,6 +47,8 @@ static uint number_of_tests= 30000; ...@@ -45,6 +47,8 @@ static uint number_of_tests= 30000;
static uint record_length_limit= PAGE_SIZE/200; static uint record_length_limit= PAGE_SIZE/200;
static uint number_of_pages= 20; static uint number_of_pages= 20;
static uint flush_divider= 1000; static uint flush_divider= 1000;
#undef SKIP_BIG_TESTS
#define SKIP_BIG_TESTS(X) /* no-op */
#else /*TEST_WRITERS*/ #else /*TEST_WRITERS*/
static uint number_of_readers= 10; static uint number_of_readers= 10;
static uint number_of_writers= 10; static uint number_of_writers= 10;
...@@ -226,7 +230,6 @@ void reader(int num) ...@@ -226,7 +230,6 @@ void reader(int num)
check_page(buffr, page * PAGE_SIZE, 0, page, -num); check_page(buffr, page * PAGE_SIZE, 0, page, -num);
} }
ok(1, "reader%d: done\n", num);
free(buffr); free(buffr);
} }
...@@ -256,7 +259,6 @@ void writer(int num) ...@@ -256,7 +259,6 @@ void writer(int num)
if (i % flush_divider == 0) if (i % flush_divider == 0)
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE); flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
} }
ok(1, "writer%d: done\n", num);
free(buffr); free(buffr);
} }
...@@ -274,6 +276,7 @@ static void *test_thread_reader(void *arg) ...@@ -274,6 +276,7 @@ static void *test_thread_reader(void *arg)
DBUG_PRINT("info", ("Thread %s ended\n", my_thread_name())); DBUG_PRINT("info", ("Thread %s ended\n", my_thread_name()));
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
ok(1, "reader%d: done\n", param);
thread_count--; thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */ VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
...@@ -294,6 +297,7 @@ static void *test_thread_writer(void *arg) ...@@ -294,6 +297,7 @@ static void *test_thread_writer(void *arg)
DBUG_PRINT("info", ("Thread %s ended\n", my_thread_name())); DBUG_PRINT("info", ("Thread %s ended\n", my_thread_name()));
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
ok(1, "writer%d: done\n", param);
thread_count--; thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */ VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
......
...@@ -22,10 +22,8 @@ static TRN *trn= &dummy_transaction_object; ...@@ -22,10 +22,8 @@ static TRN *trn= &dummy_transaction_object;
#define ITERATIONS (1600*4) #define ITERATIONS (1600*4)
#else #else
#undef SKIP_BIG_TESTS #undef SKIP_BIG_TESTS
#define SKIP_BIG_TESTS(X) /* no-op */ #define SKIP_BIG_TESTS(X) /* no-op */
#define LOG_FLAGS (TRANSLOG_SECTOR_PROTECTION | TRANSLOG_PAGE_CRC) #define LOG_FLAGS (TRANSLOG_SECTOR_PROTECTION | TRANSLOG_PAGE_CRC)
#define LOG_FILE_SIZE (1024L*1024L*8L) #define LOG_FILE_SIZE (1024L*1024L*8L)
#define ITERATIONS 1600 #define ITERATIONS 1600
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment