From 923dce2c89d8f87dc3074aa58ec4edef3668b7b7 Mon Sep 17 00:00:00 2001 From: Hui Xiao Date: Thu, 14 Dec 2023 11:24:26 -0800 Subject: [PATCH] Allow small db in crash test --- tools/db_crashtest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 93f1f2427203..ad01b5ed5f47 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -94,7 +94,7 @@ "mark_for_compaction_one_file_in": lambda: 10 * random.randint(0, 1), "max_background_compactions": 20, "max_bytes_for_level_base": 10485760, - "max_key": 25000000, + "max_key": lambda: random.choice([100000, 25000000]), "max_write_buffer_number": 3, "mmap_read": lambda: random.randint(0, 1), # Setting `nooverwritepercent > 0` is only possible because we do not vary @@ -116,7 +116,7 @@ "sst_file_manager_bytes_per_truncate": lambda: random.choice([0, 1048576]), "long_running_snapshots": lambda: random.randint(0, 1), "subcompactions": lambda: random.randint(1, 4), - "target_file_size_base": 2097152, + "target_file_size_base": lambda: random.choice([512 * 1024, 2048 * 1024]), "target_file_size_multiplier": 2, "test_batches_snapshots": random.randint(0, 1), "top_level_index_pinning": lambda: random.randint(0, 3), @@ -139,7 +139,7 @@ "value_size_mult": 32, "verification_only": 0, "verify_checksum": 1, - "write_buffer_size": 4 * 1024 * 1024, + "write_buffer_size": lambda: random.choice([1024 * 1024, 4 * 1024 * 1024]), "writepercent": 35, "format_version": lambda: random.choice([2, 3, 4, 5, 6, 6]), "index_block_restart_interval": lambda: random.choice(range(1, 16)),