From f9ba79ecd6faaa0d11e9967eb4961c36743ced73 Mon Sep 17 00:00:00 2001 From: sdong Date: Thu, 15 Oct 2015 15:39:58 -0700 Subject: [PATCH] crash_test to trigger fail points other than file appending more frequently Summary: For half of the crash_test run, disable fail point for file appending, in order to trigger other fail point more frequently. Also, tune crash test parameter a little bit for it to initialize faster. Test Plan: Run crash_test and make sure it issues db_stress commands as expected. Reviewers: yhchiang, igor, rven, anthony, IslamAbdelRahman, kradhakrishnan Reviewed By: kradhakrishnan Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D48843 --- tools/db_crashtest2.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/db_crashtest2.py b/tools/db_crashtest2.py index 4e94a01fa..93f1478bc 100644 --- a/tools/db_crashtest2.py +++ b/tools/db_crashtest2.py @@ -71,6 +71,7 @@ def main(argv): total_check_mode = 4 check_mode = 0 + kill_mode = 0 test_tmpdir = os.environ.get("TEST_TMPDIR") if test_tmpdir is None or test_tmpdir == "": @@ -83,7 +84,19 @@ def main(argv): killoption = "" if check_mode == 0: # run with kill_random_test - killoption = " --kill_random_test=" + str(kill_random_test) + if kill_mode == 0: + killoption = " --kill_random_test=" + str(kill_random_test) + elif kill_mode == 1: + # Remove kill point for normal reads and reduce kill odds + # by 3, so that it still runs about one minutes in average + # before hitting a crash point. + killoption = " --kill_random_test=" + \ + str(kill_random_test / 3 + 1) + killoption += \ + " --kill_prefix_blacklist=WritableFileWriter::Append," \ + "WritableFileWriter::WriteBuffered" + # Run kill mode 0 and 1 by turn. + kill_mode = (kill_mode + 1) % 2 # use large ops per thread since we will kill it anyway additional_opts = "--ops_per_thread=" + \ str(100 * ops_per_thread) + killoption @@ -133,6 +146,8 @@ def main(argv): --filter_deletes=%s --memtablerep=skip_list --prefix_size=0 + --nooverwritepercent=1 + --log2_keys_per_lock=10 %s """ % (threads, write_buf_size, @@ -172,6 +187,8 @@ def main(argv): --filter_deletes=%s --memtablerep=prefix_hash --prefix_size=7 + --nooverwritepercent=1 + --log2_keys_per_lock=10 %s """ % (random.randint(0, 1), threads,