Commit 8d7e960b authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5418 add --verify_period to benchmark-test


git-svn-id: file:///svn/toku/tokudb@49772 c7de825b-a66e-492c-adef-691d508d4ae1
parent abb8d017
...@@ -2,7 +2,6 @@ cmake_policy(SET CMP0012 NEW) ...@@ -2,7 +2,6 @@ cmake_policy(SET CMP0012 NEW)
## these tests shouldn't run with valgrind ## these tests shouldn't run with valgrind
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ft/benchmark-test_256
ft/bnc-insert-benchmark ft/bnc-insert-benchmark
ft/brt-serialize-benchmark ft/brt-serialize-benchmark
ft/ft_loader-test-extractor-1 ft/ft_loader-test-extractor-1
...@@ -52,11 +51,6 @@ list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ...@@ -52,11 +51,6 @@ list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ydb/upgrade-test-4.tdb ydb/upgrade-test-4.tdb
) )
## this is a smaller benchmark-test_256, just for valgrind, no need to run it without valgrind
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
ft/benchmark-test_256_vg
)
if (NOT @RUN_HELGRIND_TESTS@) if (NOT @RUN_HELGRIND_TESTS@)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE list(APPEND CTEST_CUSTOM_TESTS_IGNORE
util/helgrind_test_circular_buffer util/helgrind_test_circular_buffer
......
...@@ -50,12 +50,10 @@ if(BUILD_TESTING OR BUILD_FT_TESTS) ...@@ -50,12 +50,10 @@ if(BUILD_TESTING OR BUILD_FT_TESTS)
declare_custom_tests(benchmark-test) declare_custom_tests(benchmark-test)
add_test(ft/benchmark-test benchmark-test -q --fname benchmark-test.ft) add_test(ft/benchmark-test benchmark-test -q --fname benchmark-test.ft)
add_test(ft/benchmark-test_256 benchmark-test --valsize 256 --verify --fname benchmark-test_256.ft 1) add_test(ft/benchmark-test_256 benchmark-test --valsize 256 --verify --verify_period 4096 --fname benchmark-test_256.ft 1)
add_test(ft/benchmark-test_256_vg benchmark-test --valsize 256 --verify --fname benchmark-test_256_vg.ft --periter 131072 1)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
benchmark-test.ft benchmark-test.ft
benchmark-test_256.ft benchmark-test_256.ft
benchmark-test_256_vg.ft
) )
declare_custom_tests(ftloader-test-merge-files-dbufio) declare_custom_tests(ftloader-test-merge-files-dbufio)
......
...@@ -24,6 +24,7 @@ static enum toku_compression_method compression_method = TOKU_DEFAULT_COMPRESSIO ...@@ -24,6 +24,7 @@ static enum toku_compression_method compression_method = TOKU_DEFAULT_COMPRESSIO
static int keysize = sizeof (long long); static int keysize = sizeof (long long);
static int valsize = sizeof (long long); static int valsize = sizeof (long long);
static int do_verify =0; /* Do a slow verify after every insert. */ static int do_verify =0; /* Do a slow verify after every insert. */
static int verify_period = 1; /* how many inserts between verifies. */
static int do_serial = 1; static int do_serial = 1;
static int do_random = 1; static int do_random = 1;
...@@ -57,7 +58,13 @@ static void insert (long long v) { ...@@ -57,7 +58,13 @@ static void insert (long long v) {
memset(vc, 0, sizeof vc); memset(vc, 0, sizeof vc);
long_long_to_array(vc, v); long_long_to_array(vc, v);
toku_ft_insert(t, toku_fill_dbt(&kt, kc, keysize), toku_fill_dbt(&vt, vc, valsize), 0); toku_ft_insert(t, toku_fill_dbt(&kt, kc, keysize), toku_fill_dbt(&vt, vc, valsize), 0);
if (do_verify) toku_cachetable_verify(ct); if (do_verify) {
static int inserts_since_last_verify = 0;
inserts_since_last_verify++;
if (inserts_since_last_verify % verify_period == 0) {
toku_cachetable_verify(ct);
}
}
} }
static void serial_insert_from (long long from) { static void serial_insert_from (long long from) {
...@@ -120,6 +127,7 @@ static void usage(void) { ...@@ -120,6 +127,7 @@ static void usage(void) {
printf("[--noserial]\n"); printf("[--noserial]\n");
printf("[--norandom]\n"); printf("[--norandom]\n");
printf("[--verify]\n"); printf("[--verify]\n");
printf("[--verify_period PERIOD]\n");
} }
int int
...@@ -153,6 +161,11 @@ test_main (int argc, const char *argv[]) { ...@@ -153,6 +161,11 @@ test_main (int argc, const char *argv[]) {
} }
} else if (strcmp(arg, "--verify")==0) { } else if (strcmp(arg, "--verify")==0) {
do_verify = 1; do_verify = 1;
} else if (strcmp(arg, "--verify_period")==0) {
if (i+1 < argc) {
i++;
verify_period = atoi(argv[i]);
}
} else if (strcmp(arg, "--noserial") == 0) { } else if (strcmp(arg, "--noserial") == 0) {
do_serial = 0; do_serial = 0;
} else if (strcmp(arg, "--fname") == 0) { } else if (strcmp(arg, "--fname") == 0) {
......
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