From 2a9ea265619d4a22c3e0e7ff6972bed74a0a8243 Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Thu, 22 Jan 2026 10:24:36 -0800 Subject: [PATCH 01/15] remove experimental status on shared memory support Signed-off-by: Rob Johnson --- include/splinterdb/splinterdb.h | 10 ---------- tests/config.c | 10 +++------- tests/config.h | 2 +- tests/functional/splinter_test.c | 2 -- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/include/splinterdb/splinterdb.h b/include/splinterdb/splinterdb.h index 87586a1a..7f0ada6d 100644 --- a/include/splinterdb/splinterdb.h +++ b/include/splinterdb/splinterdb.h @@ -34,16 +34,6 @@ splinterdb_get_version(); * for all structures (default), or choose to setup a shared segment * which will be used for shared structures. * - * ******************* EXPERIMENTAL FEATURES ******************** - * - * - use_shmem: Support for shared memory segments: - * This flag will configure a shared memory segment. All (most) run-time - * memory allocation will be done from this shared segment. Currently, - * we do not support free(), so you will likely run out of shared memory - * and run into shared-memory OOM errors. This functionality is - * solely meant for internal development uses. - * - * ******************* EXPERIMENTAL FEATURES ******************** */ typedef struct splinterdb_config { // required configuration diff --git a/tests/config.c b/tests/config.c index 2c259215..d74bcb90 100644 --- a/tests/config.c +++ b/tests/config.c @@ -155,8 +155,7 @@ config_usage() platform_error_log("\t--no-verbose-logging\n"); platform_error_log("\t--verbose-progress\n"); - platform_error_log( - "\t--use-shmem **** Experimental feature ****\n"); + platform_error_log("\t--use-shmem\n"); // clang-format off platform_error_log("\t [ --shmem-capacity-mib (%lu) | --shmem-capacity-gib (%d) ]\n", (TEST_CONFIG_DEFAULT_SHMEM_SIZE_GB * KiB), @@ -414,11 +413,8 @@ config_parse(master_config *cfg, const uint8 num_config, int argc, char *argv[]) return STATUS_BAD_PARAM; } if (cfg[cfg_idx].max_key_size < TEST_CONFIG_MIN_KEY_SIZE) { - platform_error_log("Configured key-size, %lu, should be at least " - "%d bytes. Support for smaller key-sizes is " - "experimental.\n", - cfg[cfg_idx].max_key_size, - TEST_CONFIG_MIN_KEY_SIZE); + platform_error_log("Configured key-size, %lu.\n", + cfg[cfg_idx].max_key_size); return STATUS_BAD_PARAM; } } diff --git a/tests/config.h b/tests/config.h index cd513f36..83a1d2c2 100644 --- a/tests/config.h +++ b/tests/config.h @@ -87,7 +87,7 @@ typedef struct master_config { bool verbose_logging_enabled; bool verbose_progress; - // Shared memory support **** Experimental feature **** + // Shared memory support uint64 shmem_size; bool use_shmem; // Memory allocation done from shared segment bool fork_child; // Default is FALSE diff --git a/tests/functional/splinter_test.c b/tests/functional/splinter_test.c index 619264c4..ca938514 100644 --- a/tests/functional/splinter_test.c +++ b/tests/functional/splinter_test.c @@ -2340,8 +2340,6 @@ usage(const char *argv0) argv0); platform_error_log("\nNOTE: splinter_basic basic has been refactored" " to run as a stand-alone unit-test.\n"); - platform_error_log(" --use-shmem is an experimental feature." - " Use with care.\n"); platform_error_log("\n"); test_config_usage(); config_usage(); From d3f3cbe7163870acc84ea58b78d6f6b5820056b6 Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Fri, 23 Jan 2026 14:29:23 -0800 Subject: [PATCH 02/15] new test infra --- .github/workflows/run-tests.yml | 50 +---- Makefile | 3 + newtests.sh | 154 ++++++++++++++++ src/platform_linux/platform_io.h | 1 - test.sh | 211 ++++++++++++---------- tests/config.c | 2 +- tests/config.h | 2 + tests/functional/io_apis_test.c | 2 +- tests/functional/log_test.c | 1 + tests/unit/large_inserts_stress_test.c | 4 +- tests/unit/limitations_test.c | 2 +- tests/unit/splinterdb_forked_child_test.c | 10 +- tests/unit/splinterdb_quick_test.c | 2 +- tests/unit/splinterdb_stress_test.c | 12 +- tests/unit/unit_tests.h | 3 - timing_utils.sh | 62 +++++++ 16 files changed, 352 insertions(+), 169 deletions(-) create mode 100755 newtests.sh create mode 100644 timing_utils.sh diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2286d4e4..f7f6b618 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -21,50 +21,9 @@ jobs: matrix: compiler_mode: [gcc, clang, gcc-asan, clang-msan] build_mode: [release, debug] - target: [all] # Just compile most configs - include_slow_tests: ['true'] - run_nightly_tests: ['false'] - exclude: - # Don't do a compile job on these, since we will do run-tests on them below - - compiler_mode: gcc-asan - build_mode: release - target: all - - compiler_mode: clang-msan - build_mode: release - target: all - - compiler_mode: clang - build_mode: debug - target: all - - compiler_mode: gcc - build_mode: release - target: all - include: - # Compile and run tests on these configs - - compiler_mode: gcc-asan - build_mode: release - target: run-tests - include_slow_tests: 'true' - run_nightly_tests: 'false' - - compiler_mode: clang-msan - build_mode: release - target: run-tests - include_slow_tests: 'true' - run_nightly_tests: 'false' - - compiler_mode: clang - build_mode: debug - target: run-tests - include_slow_tests: 'true' - run_nightly_tests: 'false' - - compiler_mode: gcc - build_mode: release - target: run-tests - include_slow_tests: 'false' - run_nightly_tests: 'true' - name: > - ${{ matrix.target == 'all' && 'Compile' || 'Run' }} - ${{ matrix.compiler_mode }} ${{ matrix.build_mode }} ${{ matrix.target }} - ${{ matrix.target == 'run-tests' && matrix.include_slow_tests == 'true' && '(slow tests)' || '' }} - ${{ matrix.target == 'run-tests' && matrix.run_nightly_tests == 'true' && '(nightly tests)' || '' }} + target: [newtests] + newtests_function: [cache_tests, functionality_tests, parallel_perf_tests, perf_tests, splinter_misc_tests, large_insert_stress_tests, misc_tests] + name: ${{ matrix.compiler_mode }} ${{ matrix.build_mode }} ${{ matrix.newtests_function }} runs-on: ubuntu-latest env: CC: ${{ startsWith(matrix.compiler_mode, 'gcc') && 'gcc' || 'clang' }} @@ -72,8 +31,7 @@ jobs: BUILD_MODE: ${{ matrix.build_mode }} BUILD_ASAN: ${{ endsWith(matrix.compiler_mode, 'asan') && 1 || 0 }} BUILD_MSAN: ${{ endsWith(matrix.compiler_mode, 'msan') && 1 || 0 }} - INCLUDE_SLOW_TESTS: ${{ matrix.include_slow_tests }} - RUN_NIGHTLY_TESTS: ${{ matrix.run_nightly_tests }} + NEWTESTS_FUNCTION: ${{ matrix.newtests_function }} steps: - name: Maximize build space uses: easimon/maximize-build-space@master diff --git a/Makefile b/Makefile index 8931373f..98f07709 100644 --- a/Makefile +++ b/Makefile @@ -560,6 +560,9 @@ run-tests: all-tests test-results: all-tests INCLUDE_SLOW_TESTS=true BINDIR=$(BINDIR) ./test.sh 2>&1 | tee ./test-results +newtests: all-tests + BINDIR=$(BINDIR) ./newtests.sh + run-examples: all-examples for i in $(EXAMPLES_BINS); do $$i || exit; done diff --git a/newtests.sh b/newtests.sh new file mode 100755 index 00000000..5d94c63a --- /dev/null +++ b/newtests.sh @@ -0,0 +1,154 @@ +#!/bin/bash + +set -e + +source timing_utils.sh + +function run() +{ + run_with_timing "$*" ${BINDIR}/$@ + rm -f db +} + +# 14 minutes +function cache_tests() { + # 25 sec each + run driver_test cache_test --perf + run driver_test cache_test --perf --use-shmem + # 390 sec each + run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 + run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 --use-shmem + # 3 sec each + run driver_test cache_test --seed 135 + run driver_test cache_test --seed 135 --use-shmem + + # 8 sec + run driver_test cache_test --async + +} + +# 12 minutes +function functionality_tests() { + # 50 sec each + run driver_test splinter_test --functionality 1000000 100 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --num-normal-bg-threads 4 --num-memtable-bg-threads 2 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --key-size 102 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --key-size 8 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --use-shmem --seed 135 + run driver_test splinter_test --functionality 1000000 100 --use-shmem --num-normal-bg-threads 4 --num-memtable-bg-threads 2 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --use-shmem --key-size 102 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --use-shmem --key-size 8 --seed 135 + run driver_test splinter_test --functionality 1000000 1000 --num-tables 2 --cache-capacity-mib 1024 + run driver_test splinter_test --functionality 1000000 1000 --num-tables 4 --cache-capacity-mib 1024 + run driver_test splinter_test --functionality 1000000 1000 --num-tables 4 --cache-capacity-mib 512 + run driver_test splinter_test --functionality 10000000 1000 --num-tables 1 --cache-capacity-mib 4096 + run driver_test splinter_test --functionality 10000000 1000 --num-tables 2 --cache-capacity-mib 4096 +} + +# 8 minutes +function parallel_perf_tests() { + # 115 sec each + run driver_test splinter_test --parallel-perf --max-async-inflight 0 --num-pthreads 8 --lookup-positive-percent 10 --tree-size-gib 8 --db-capacity-gib 60 + run driver_test splinter_test --parallel-perf --max-async-inflight 0 --num-pthreads 8 --lookup-positive-percent 10 --tree-size-gib 8 --db-capacity-gib 60 --use-shmem + run driver_test splinter_test --parallel-perf --max-async-inflight 10 --num-pthreads 20 --tree-size-gib 5 --num-normal-bg-threads 20 --num-memtable-bg-threads 2 --db-capacity-gib 60 + run driver_test splinter_test --parallel-perf --max-async-inflight 10 --num-pthreads 20 --tree-size-gib 5 --num-normal-bg-threads 20 --num-memtable-bg-threads 2 --db-capacity-gib 60 +} + +# 10 minutes +function perf_tests() { + # 60 sec each + run driver_test splinter_test --perf --num-insert-threads 4 --num-lookup-threads 4 --num-inserts 10000 --cache-capacity-mib 512 --num-normal-bg-threads 1 --num-memtable-bg-threads 1 + run driver_test splinter_test --perf --num-insert-threads 63 --num-range-lookup-threads 0 --tree-size-gib 1 + run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 0 --tree-size-gib 2 --cache-capacity-mib 512 + run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 4 --lookup-positive-percent 10 --num-inserts 10000 --cache-capacity-mib 512 --verbose-progress + run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 8 --num-lookup-threads 8 --num-range-lookup-threads 8 --lookup-positive-percent 10 --tree-size-gib 4 --db-capacity-gib 60 --verbose-progress + run driver_test splinter_test --perf --use-shmem --num-insert-threads 4 --num-lookup-threads 4 --num-inserts 10000 --cache-capacity-mib 512 --num-normal-bg-threads 1 --num-memtable-bg-threads 1 + run driver_test splinter_test --perf --use-shmem --num-insert-threads 63 --num-range-lookup-threads 0 --tree-size-gib 1 + run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 0 --tree-size-gib 2 --cache-capacity-mib 512 + run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 4 --lookup-positive-percent 10 --num-inserts 10000 --cache-capacity-mib 512 --verbose-progress + run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 8 --num-lookup-threads 8 --num-range-lookup-threads 8 --lookup-positive-percent 10 --tree-size-gib 4 --db-capacity-gib 60 --verbose-progress +} + +# 2.5 minutes +function splinter_misc_tests() +{ + # 30 sec each + run driver_test splinter_test --delete --tree-size-gib 1 + run driver_test splinter_test --seq-perf --tree-size-gib 1 + run driver_test splinter_test --semiseq-perf --tree-size-gib 1 + # 60 sec + run driver_test splinter_test --periodic --tree-size-gib 1 + +} + +# 11 minutes +function large_insert_stress_tests() { + # 25, 50, 250 sec each (prob. total of 650 sec for all 6 tests) + run unit/large_inserts_stress_test --num-inserts 1000000 + run unit/large_inserts_stress_test --num-inserts 2000000 --num-normal-bg-threads 4 --num-memtable-bg-threads 3 + run unit/large_inserts_stress_test --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 + run unit/large_inserts_stress_test --use-shmem --num-inserts 1000000 + run unit/large_inserts_stress_test --use-shmem --num-inserts 2000000 --num-normal-bg-threads 4 --num-memtable-bg-threads 3 + run unit/large_inserts_stress_test --use-shmem --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 +} + +# 8 minutes +function misc_tests() { + # 15 sec each + # default: 24 + run driver_test btree_test --seed 135 + run driver_test btree_test --use-shmem --seed 135 + run driver_test btree_test --key-size 8 --seed 135 + run driver_test btree_test --key-size 8 --use-shmem --seed 135 + run driver_test btree_test --key-size 100 --seed 135 + run driver_test btree_test --key-size 100 --use-shmem --seed 135 + + # 17 sec each + # default: 1 (but --perf requires >= 4) + run driver_test btree_test --perf --cache-capacity-gib 4 --seed 135 + run driver_test btree_test --perf --cache-capacity-gib 4 --seed 135 --use-shmem + + # 2 sec each + run driver_test filter_test --seed 135 + run driver_test filter_test --seed 135 --use-shmem + # 255 sec + run driver_test filter_test --perf + + # 1 sec each + run driver_test log_test --seed 135 + run driver_test log_test --seed 135 --use-shmem + run driver_test log_test --crash + # 14 sec + run driver_test log_test --perf + + # 12 sec each + run unit/splinter_test --num-inserts 2000000 test_lookups + run unit/splinter_test --use-shmem --num-inserts 2000000 test_lookups + + # 2 sec each + run unit/splinter_test test_inserts + run unit/splinter_test test_splinter_print_diags + run unit/splinter_test --use-shmem test_inserts + run unit/splinter_test --use-shmem test_splinter_print_diags + + # 40 sec each + run unit_test + run unit_test --use-shmem +} + +function all_tests() { + cache_tests + functionality_tests + parallel_perf_tests + perf_tests + splinter_misc_tests + large_insert_stress_tests + misc_tests +} + +function main() { + $NEWTESTS_FUNCTION + cat_exec_log_file +} + +main "$@" diff --git a/src/platform_linux/platform_io.h b/src/platform_linux/platform_io.h index 1db7cb76..72467cd3 100644 --- a/src/platform_linux/platform_io.h +++ b/src/platform_linux/platform_io.h @@ -37,7 +37,6 @@ struct iovec; #define IO_DEFAULT_FLAGS (O_RDWR | O_CREAT) #define IO_DEFAULT_PERMS (0755) #define IO_DEFAULT_KERNEL_QUEUE_SIZE (256) -#define IO_DEFAULT_FILENAME "db" #define IO_DEFAULT_ASYNC_QUEUE_DEPTH (256) /* diff --git a/test.sh b/test.sh index 3c465259..21158485 100755 --- a/test.sh +++ b/test.sh @@ -119,7 +119,7 @@ function run_with_timing() { start_seconds=$SECONDS echo " " set -x - "$@" + echo "$@" set +x record_elapsed_time $start_seconds "${test_tag}" } @@ -158,80 +158,37 @@ function cat_exec_log_file() { # We exercise large'ish # of inserts, 100 million, with different cache sizes, # to get some coverage on core functionality in stress workloads. # ############################################################################# -function nightly_functionality_stress_tests() { +function run_functionality_stress_test() { + local n_mills=$1 + local ntables=$2 + local cache_size_mb=$3 - # Future: We want to crank this up to 100 mil rows, but assertions around - # trunk bundle mgmt prevent that. - local n_mills=10 local num_rows=$((n_mills * 1000 * 1000)) local nrows_h="${n_mills} mil" - local ntables=1 local test_name="splinter_test --functionality" - - # ---- - local cache_size=4 # GB - local test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} GiB cache" + local test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size_mb} MiB cache" local dbname="splinter_test.functionality.db" - echo "$Me: Run ${test_name} with ${n_mills} million rows, on ${ntables} tables, with ${cache_size} GiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-gib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} - # ---- - ntables=2 - local test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} GiB cache" - local dbname="splinter_test.functionality.db" - echo "$Me: Run ${test_name} with ${n_mills} million rows, on ${ntables} tables, with ${cache_size} GiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-gib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} - # ---- - cache_size=1 # GiB - - # Remove this block once issue #322 is fixed. - n_mills=1 - num_rows=$((n_mills * 1000 * 1000)) - nrows_h="${n_mills} mil" - - test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" - echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with default ${cache_size} GiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-gib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} - - # ---- - ntables=4 - cache_size=1 # GiB - test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" - echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with default ${cache_size} GiB cache" + echo "$Me: Run ${test_name} with ${n_mills} million rows, on ${ntables} tables, with ${cache_size_mb} MiB cache" run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ + "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ --num-tables ${ntables} \ - --cache-capacity-gib ${cache_size} \ + --cache-capacity-mib ${cache_size_mb} \ --db-location ${dbname} - rm ${dbname} + rm -f ${dbname} +} - # ---- - cache_size=512 # MiB - test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" - # echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with small ${cache_size} MiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-mib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} +function nightly_functionality_stress_tests() { + # Future: We want to crank this up to 100 mil rows, but assertions around + # trunk bundle mgmt prevent that. + # millions_of_rows num_tables cache_size_mb + run_functionality_stress_test 10 1 4096 + run_functionality_stress_test 10 2 4096 + run_functionality_stress_test 1 2 1024 + run_functionality_stress_test 1 4 1024 + run_functionality_stress_test 1 4 512 } # ############################################################################# @@ -240,6 +197,11 @@ function nightly_functionality_stress_tests() { # of execution, especially to shake out AIO / thread registration issues. # ############################################################################# function nightly_unit_stress_tests() { + local use_msg= + if [ "$Use_shmem" != "" ]; then + use_msg=", using shared memory" + fi + local n_mills=10 local num_rows=$((n_mills * 1000 * 1000)) local nrows_h="${n_mills} mil" @@ -251,14 +213,14 @@ function nightly_unit_stress_tests() { local test_name=large_inserts_stress_test echo "$Me: Run ${test_name} with ${n_mills} million rows, ${n_threads} threads" - run_with_timing "Large Inserts Stress test ${test_descr}" \ + run_with_timing "Large Inserts Stress test ${test_descr}${use_msg}" \ "$BINDIR"/unit/${test_name} \ $Use_shmem \ --shmem-capacity-gib 8 \ --num-inserts ${num_rows} \ --num-memtable-bg-threads 8 \ --num-normal-bg-threads 20 - rm ${dbname} + rm -f ${dbname} } @@ -308,7 +270,7 @@ function nightly_sync_perf_tests() { --db-location ${dbname} \ --verbose-progress \ ${Use_shmem} - rm ${dbname} + rm -f ${dbname} local npthreads=8 local tree_size=8 # GiB @@ -325,7 +287,7 @@ function nightly_sync_perf_tests() { --db-capacity-gib 60 \ --db-location ${dbname} \ ${Use_shmem} - rm ${dbname} + rm -f ${dbname} # Exercise a case with max # of insert-threads which tripped an assertion # This isn't really a 'perf' test but a regression / stability test exec @@ -342,7 +304,7 @@ function nightly_sync_perf_tests() { --tree-size-gib 1 \ --db-location ${dbname} \ ${Use_shmem} - rm ${dbname} + rm -f ${dbname} } # ############################################################################# @@ -361,7 +323,7 @@ function nightly_cache_perf_tests() { "$BINDIR"/driver_test cache_test --perf \ --db-location ${dbname} \ ${Use_shmem} - rm ${dbname} + rm -f ${dbname} cache_size=6 # GiB test_descr="${cache_size} GiB cache" @@ -372,7 +334,7 @@ function nightly_cache_perf_tests() { --cache-capacity-gib ${cache_size} \ --db-capacity-gib 60 \ ${Use_shmem} - rm ${dbname} + rm -f ${dbname} } # ############################################################################# @@ -398,7 +360,7 @@ function nightly_async_perf_tests() { --num-memtable-bg-threads 2 \ --db-capacity-gib 60 \ --db-location ${dbname} - rm ${dbname} + rm -f ${dbname} } # ############################################################################# @@ -611,12 +573,12 @@ function run_fast_unit_tests() { # shellcheck disable=SC2086 "$BINDIR"/unit/task_system_test $Use_shmem - rm splinterdb_unit_tests_db + rm -f splinterdb_unit_tests_db echo " " # shellcheck disable=SC2086 "$BINDIR"/driver_test io_apis_test $Use_shmem - rm db + rm -f db } # ################################################################## @@ -643,7 +605,7 @@ function run_slower_unit_tests() { # in the program to cough-up an error. # shellcheck disable=SC2086 run_with_timing "${msg}" "$BINDIR"/unit/splinter_test ${Use_shmem} test_inserts - rm db + rm -f db # Use fewer rows for this case, to keep elapsed times of MSAN runs reasonable. msg="Splinter lookups test ${use_msg}" @@ -652,7 +614,7 @@ function run_slower_unit_tests() { # shellcheck disable=SC2086 run_with_timing "${msg}" \ "$BINDIR"/unit/splinter_test ${Use_shmem} --num-inserts ${num_rows} test_lookups - rm db + rm -f db unset VERBOSE @@ -660,7 +622,7 @@ function run_slower_unit_tests() { # shellcheck disable=SC2086 run_with_timing "${msg}" \ "$BINDIR"/unit/splinter_test ${Use_shmem} test_splinter_print_diags - rm db + rm -f db # Test runs w/ default of 1M rows for --num-inserts n_mills=1 @@ -670,7 +632,7 @@ function run_slower_unit_tests() { # shellcheck disable=SC2086 run_with_timing "${msg}" \ "$BINDIR"/unit/large_inserts_stress_test ${Use_shmem} --num-inserts ${num_rows} - rm splinterdb_unit_tests_db + rm -f splinterdb_unit_tests_db # Test runs w/ more inserts and enable bg-threads n_mills=2 @@ -683,7 +645,7 @@ function run_slower_unit_tests() { --num-inserts ${num_rows} \ --num-normal-bg-threads 4 \ --num-memtable-bg-threads 3 - rm splinterdb_unit_tests_db + rm -f splinterdb_unit_tests_db } # ################################################################## @@ -698,13 +660,13 @@ function run_slower_forked_process_tests() { local msg="Splinter tests using default number of forked child processes" run_with_timing "${msg}" "$BINDIR"/unit/splinterdb_forked_child_test - rm splinterdb_forked_child_test_db + rm -f splinterdb_forked_child_test_db num_forked_procs=4 msg="Splinter tests using ${num_forked_procs} forked child processes" run_with_timing "${msg}" "$BINDIR"/unit/splinterdb_forked_child_test \ --num-processes ${num_forked_procs} - rm splinterdb_unit_tests_db + rm -f splinterdb_unit_tests_db # ---- Run large_inserts_stress_test with small configuration as a quick check # using forked child process execution. @@ -716,7 +678,7 @@ function run_slower_forked_process_tests() { --fork-child \ --num-inserts ${num_rows} \ test_seq_key_seq_values_inserts_forked - rm splinterdb_unit_tests_db + rm -f splinterdb_unit_tests_db } # ################################################################## @@ -736,14 +698,14 @@ function run_splinter_functionality_tests() { "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ $Use_shmem \ --key-size ${key_size} --seed "$SEED" - rm db + rm -f db # shellcheck disable=SC2086 run_with_timing "Functionality test, with default key size${use_msg}" \ "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ $Use_shmem \ --seed "$SEED" - rm db + rm -f db # shellcheck disable=SC2086 run_with_timing "Functionality test, default key size, with background threads${use_msg}" \ @@ -751,7 +713,7 @@ function run_splinter_functionality_tests() { $Use_shmem \ --num-normal-bg-threads 4 --num-memtable-bg-threads 2 \ --seed "$SEED" - rm db + rm -f db max_key_size=102 # shellcheck disable=SC2086 @@ -759,7 +721,7 @@ function run_splinter_functionality_tests() { "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ $Use_shmem \ --key-size ${max_key_size} --seed "$SEED" - rm db + rm -f db } # ################################################################## @@ -785,7 +747,7 @@ function run_splinter_perf_tests() { --num-inserts 10000 \ --cache-capacity-mib 512 \ --verbose-progress - rm db + rm -f db # Re-run small perf test configuring background threads. This scenario # validates that we can configure bg- and user-threads in one go. @@ -799,7 +761,7 @@ function run_splinter_perf_tests() { --cache-capacity-mib 512 \ --num-normal-bg-threads 1 \ --num-memtable-bg-threads 1 - rm db + rm -f db # shellcheck disable=SC2086 run_with_timing "Performance test${use_msg}" \ @@ -811,7 +773,7 @@ function run_splinter_perf_tests() { --num-range-lookup-threads 0 \ --tree-size-gib 2 \ --cache-capacity-mib 512 - rm db + rm -f db } # ################################################################## @@ -828,19 +790,19 @@ function run_btree_tests() { "$BINDIR"/driver_test btree_test --key-size ${key_size} \ $Use_shmem \ --seed "$SEED" - rm db + rm -f db # shellcheck disable=SC2086 run_with_timing "BTree test, with default key size${use_msg}" \ "$BINDIR"/driver_test btree_test $Use_shmem --seed "$SEED" - rm db + rm -f db key_size=100 # shellcheck disable=SC2086 run_with_timing "BTree test, key size=${key_size} bytes${use_msg}" \ "$BINDIR"/driver_test btree_test $Use_shmem \ --key-size ${key_size} --seed "$SEED" - rm db + rm -f db # shellcheck disable=SC2086 run_with_timing "BTree Perf test${use_msg}" \ @@ -848,7 +810,7 @@ function run_btree_tests() { --cache-capacity-gib 4 \ --seed "$SEED" \ $Use_shmem - rm db + rm -f db } # ################################################################## @@ -862,17 +824,17 @@ function run_other_driver_tests() { # shellcheck disable=SC2086 run_with_timing "Cache test${use_msg}" \ "$BINDIR"/driver_test cache_test --seed "$SEED" $Use_shmem - rm db + rm -f db # shellcheck disable=SC2086 run_with_timing "Log test${use_msg}" \ "$BINDIR"/driver_test log_test --seed "$SEED" $Use_shmem - rm db + rm -f db # shellcheck disable=SC2086 run_with_timing "Filter test${use_msg}" \ "$BINDIR"/driver_test filter_test --seed "$SEED" $Use_shmem - rm db + rm -f db } # ####################################################################### @@ -893,7 +855,7 @@ function run_tests_with_shared_memory() { # Run all the unit-tests first, to get basic coverage of shared-memory support. run_with_timing "Fast unit tests using shared memory" "$BINDIR"/unit_test "--use-shmem" - rm splinterdb_unit_tests_db + rm -f splinterdb_unit_tests_db # Additional case exercised while developing shared memory support for multi # process execution to verify management of IO-contexts under forked processes @@ -903,7 +865,7 @@ function run_tests_with_shared_memory() { # rm splinterdb_io_apis_test_db Use_shmem="--use-shmem" run_slower_unit_tests - if [ -f "${UNIT_TESTS_DB_DEV}" ]; then rm "${UNIT_TESTS_DB_DEV}"; fi + if [ -f "${UNIT_TESTS_DB_DEV}" ]; then rm -f "${UNIT_TESTS_DB_DEV}"; fi Use_shmem="--use-shmem" run_splinter_functionality_tests @@ -919,6 +881,59 @@ function run_tests_with_shared_memory() { record_elapsed_time ${shmem_tests_run_start} "Tests with shared memory configured" } + +function all_tests() +{ + run_functionality_stress_test 10 1 4096 + run_functionality_stress_test 10 2 4096 + run_functionality_stress_test 1 2 1024 + run_functionality_stress_test 1 4 1024 + run_functionality_stress_test 1 4 512 + + Use_shmem="" nightly_unit_stress_tests + Use_shmem="--use-shmem" nightly_unit_stress_tests + + Use_shmem="" nightly_sync_perf_tests + Use_shmem="--use-shmem" nightly_sync_perf_tests + + Use_shmem="" nightly_cache_perf_tests + Use_shmem="--use-shmem" nightly_cache_perf_tests + + Use_shmem="" nightly_async_perf_tests + Use_shmem="--use-shmem" nightly_async_perf_tests + + set +e + run_with_timing "Check limits, error conditions." nightly_test_limitations + set -e + + run_with_timing "Basic build-and-test tests" test_make_run_tests + + run_with_timing "Smoke tests" run_fast_unit_tests "" + + Use_shmem="--use-shmem" + run_with_timing "Smoke tests using shared memory" run_fast_unit_tests + + Use_shmem="--use-shmem" run_slower_unit_tests + Use_shmem="" run_slower_unit_tests + + Use_shmem="" run_splinter_functionality_tests + + Use_shmem="" run_splinter_perf_tests + + Use_shmem="" run_btree_tests + + Use_shmem="" run_other_driver_tests + + run_with_timing "Fast unit tests using shared memory" "$BINDIR"/unit_test "--use-shmem" + + Use_shmem="--use-shmem" run_slower_unit_tests + + Use_shmem="--use-shmem" run_splinter_functionality_tests + Use_shmem="--use-shmem" run_splinter_perf_tests + Use_shmem="--use-shmem" run_btree_tests + Use_shmem="--use-shmem" run_other_driver_tests +} + # ################################################################## # main() begins here # ################################################################## @@ -1040,7 +1055,7 @@ if [ "$INCLUDE_SLOW_TESTS" == "true" ]; then Use_shmem="" run_slower_unit_tests - if [ -f ${UNIT_TESTS_DB_DEV} ]; then rm ${UNIT_TESTS_DB_DEV}; fi + if [ -f ${UNIT_TESTS_DB_DEV} ]; then rm -f ${UNIT_TESTS_DB_DEV}; fi run_splinter_functionality_tests diff --git a/tests/config.c b/tests/config.c index d74bcb90..df45e365 100644 --- a/tests/config.c +++ b/tests/config.c @@ -69,7 +69,7 @@ void config_set_defaults(master_config *cfg) { *cfg = (master_config){ - .io_filename = "db", + .io_filename = TEST_CONFIG_DEFAULT_IO_FILENAME, .cache_logfile = "cache_log", .page_size = TEST_CONFIG_DEFAULT_PAGE_SIZE, .extent_size = TEST_CONFIG_DEFAULT_EXTENT_SIZE, diff --git a/tests/config.h b/tests/config.h index 83a1d2c2..e42633cc 100644 --- a/tests/config.h +++ b/tests/config.h @@ -29,6 +29,8 @@ _Static_assert(TEST_CONFIG_DEFAULT_PAGES_PER_EXTENT <= MAX_PAGES_PER_EXTENT, #define TEST_CONFIG_DEFAULT_EXTENT_SIZE \ (TEST_CONFIG_DEFAULT_PAGES_PER_EXTENT * TEST_CONFIG_DEFAULT_PAGE_SIZE) +#define TEST_CONFIG_DEFAULT_IO_FILENAME "db" + /* * -------------------------------------------------------------------------- * Convenience structure to hold configuration options for all sub-systems. diff --git a/tests/functional/io_apis_test.c b/tests/functional/io_apis_test.c index c4bf6986..bc2064ae 100644 --- a/tests/functional/io_apis_test.c +++ b/tests/functional/io_apis_test.c @@ -222,7 +222,7 @@ splinter_io_apis_test(int argc, char *argv[]) master_cfg.io_flags, master_cfg.io_perms, master_cfg.io_async_queue_depth, - "splinterdb_io_apis_test_db"); + TEST_CONFIG_DEFAULT_IO_FILENAME); int pid = platform_get_os_pid(); platform_default_log("Parent OS-pid=%d, Exercise IO sub-system test on" diff --git a/tests/functional/log_test.c b/tests/functional/log_test.c index d7defa8d..79fcb067 100644 --- a/tests/functional/log_test.c +++ b/tests/functional/log_test.c @@ -350,6 +350,7 @@ log_test(int argc, char *argv[]) platform_assert(rc == 0); } + io_wait_all(io); clockcache_deinit(cc); platform_free(hid, log); platform_free(hid, cc); diff --git a/tests/unit/large_inserts_stress_test.c b/tests/unit/large_inserts_stress_test.c index d52ad9d0..0b9c1069 100644 --- a/tests/unit/large_inserts_stress_test.c +++ b/tests/unit/large_inserts_stress_test.c @@ -122,8 +122,8 @@ CTEST_SETUP(large_inserts_stress) &data->hid); platform_assert_status_ok(rc); - data->cfg = (splinterdb_config){.filename = TEST_DB_NAME, - .io_flags = data->master_cfg.io_flags, + data->cfg = (splinterdb_config){.filename = TEST_CONFIG_DEFAULT_IO_FILENAME, + .io_flags = data->master_cfg.io_flags, .cache_size = 1 * Giga, .disk_size = 40 * Giga, .use_shmem = data->master_cfg.use_shmem, diff --git a/tests/unit/limitations_test.c b/tests/unit/limitations_test.c index 46464fbd..83465242 100644 --- a/tests/unit/limitations_test.c +++ b/tests/unit/limitations_test.c @@ -391,7 +391,7 @@ create_default_cfg(splinterdb_config *out_cfg, bool use_shmem) { *out_cfg = - (splinterdb_config){.filename = TEST_DB_NAME, + (splinterdb_config){.filename = TEST_CONFIG_DEFAULT_IO_FILENAME, .cache_size = 64 * Mega, .disk_size = 127 * Mega, .page_size = TEST_CONFIG_DEFAULT_PAGE_SIZE, diff --git a/tests/unit/splinterdb_forked_child_test.c b/tests/unit/splinterdb_forked_child_test.c index bdf44938..6f6b0c6d 100644 --- a/tests/unit/splinterdb_forked_child_test.c +++ b/tests/unit/splinterdb_forked_child_test.c @@ -109,8 +109,6 @@ CTEST2(splinterdb_forked_child, test_data_structures_handles) create_default_cfg(&splinterdb_cfg, splinter_data_cfgp); - splinterdb_cfg.filename = "splinterdb_forked_child_test_db"; - splinterdb *spl_handle; // To a running SplinterDB instance int rc = splinterdb_create(&splinterdb_cfg, &spl_handle); ASSERT_EQUAL(0, rc); @@ -182,8 +180,6 @@ CTEST2(splinterdb_forked_child, test_one_insert_then_close_bug) create_default_cfg(&splinterdb_cfg, splinter_data_cfgp); - splinterdb_cfg.filename = "splinterdb_forked_child_test_db"; - splinterdb *spl_handle; // To a running SplinterDB instance int rc = splinterdb_create(&splinterdb_cfg, &spl_handle); ASSERT_EQUAL(0, rc); @@ -301,8 +297,6 @@ CTEST2(splinterdb_forked_child, create_default_cfg(&splinterdb_cfg, splinter_data_cfgp); - splinterdb_cfg.filename = "splinterdb_forked_child_test_db"; - splinterdb *spl_handle; // To a running SplinterDB instance int rc = splinterdb_create(&splinterdb_cfg, &spl_handle); ASSERT_EQUAL(0, rc); @@ -405,8 +399,6 @@ CTEST2(splinterdb_forked_child, test_multiple_forked_process_doing_IOs) // hammering at it with large #s of inserts. splinterdb_cfg.cache_size = (1 * Giga); - splinterdb_cfg.filename = "splinterdb_forked_child_test_db"; - splinterdb *spl_handle; // To a running SplinterDB instance int rc = splinterdb_create(&splinterdb_cfg, &spl_handle); ASSERT_EQUAL(0, rc); @@ -512,7 +504,7 @@ CTEST2(splinterdb_forked_child, test_multiple_forked_process_doing_IOs) static void create_default_cfg(splinterdb_config *out_cfg, data_config *default_data_cfg) { - *out_cfg = (splinterdb_config){.filename = TEST_DB_NAME, + *out_cfg = (splinterdb_config){.filename = TEST_CONFIG_DEFAULT_IO_FILENAME, .cache_size = 64 * Mega, .disk_size = 10 * Giga, .use_shmem = TRUE, diff --git a/tests/unit/splinterdb_quick_test.c b/tests/unit/splinterdb_quick_test.c index f6108580..be3868f9 100644 --- a/tests/unit/splinterdb_quick_test.c +++ b/tests/unit/splinterdb_quick_test.c @@ -967,7 +967,7 @@ CTEST2(splinterdb_quick, test_splinterdb_create_w_all_background_threads) static void create_default_cfg(splinterdb_config *out_cfg, data_config *default_data_cfg) { - *out_cfg = (splinterdb_config){.filename = TEST_DB_NAME, + *out_cfg = (splinterdb_config){.filename = TEST_CONFIG_DEFAULT_IO_FILENAME, .cache_size = 64 * Mega, .disk_size = 127 * Mega, .use_shmem = FALSE, diff --git a/tests/unit/splinterdb_stress_test.c b/tests/unit/splinterdb_stress_test.c index 73d6580a..08645c3d 100644 --- a/tests/unit/splinterdb_stress_test.c +++ b/tests/unit/splinterdb_stress_test.c @@ -48,12 +48,12 @@ CTEST_DATA(splinterdb_stress) CTEST_SETUP(splinterdb_stress) { platform_register_thread(); - data->cfg = (splinterdb_config){.filename = TEST_DB_NAME, - .cache_size = 1000 * Mega, - .disk_size = 9000 * Mega, - .data_cfg = &data->default_data_config, - .num_memtable_bg_threads = 2, - .num_normal_bg_threads = 2}; + data->cfg = (splinterdb_config){.filename = TEST_CONFIG_DEFAULT_IO_FILENAME, + .cache_size = 1000 * Mega, + .disk_size = 9000 * Mega, + .data_cfg = &data->default_data_config, + .num_memtable_bg_threads = 2, + .num_normal_bg_threads = 2}; size_t max_key_size = TEST_KEY_SIZE; default_data_config_init(max_key_size, data->cfg.data_cfg); diff --git a/tests/unit/unit_tests.h b/tests/unit/unit_tests.h index 01795994..74e7f385 100644 --- a/tests/unit/unit_tests.h +++ b/tests/unit/unit_tests.h @@ -7,9 +7,6 @@ #include "ctest.h" -/* Name of SplinterDB device created for unit-tests */ -#define TEST_DB_NAME "splinterdb_unit_tests_db" - #define Kilo (1024UL) #define Mega (1024UL * Kilo) #define Giga (1024UL * Mega) diff --git a/timing_utils.sh b/timing_utils.sh new file mode 100644 index 00000000..b7b39f34 --- /dev/null +++ b/timing_utils.sh @@ -0,0 +1,62 @@ +# Name of /tmp file to record test-execution times +test_exec_log_file="/tmp/${Me}.$$.log" + +# Global, that will be re-set at the start of each test's execution +start_seconds=0 + + +# ################################################################## +# Compute elapsed time for full run, and convert to units of h, m, s +# This function also logs a line-entry to a /tmp-file, which will be +# emitted later as a summary report. +# ################################################################## +function record_elapsed_time() { + local start_sec=$1 + local test_tag=$2 + + # Computed elapsed hours, mins, seconds from total elapsed seconds + total_seconds=$((SECONDS - start_sec)) + el_h=$((total_seconds / 3600)) + el_m=$((total_seconds % 3600 / 60)) + el_s=$((total_seconds % 60)) + + echo "${Me}: $(TZ="America/Los_Angeles" date) ${test_tag}: ${total_seconds} s [ ${el_h}h ${el_m}m ${el_s}s ]" + + # Construct print format string for use by awk + local fmtstr="%-105s: %4ds [ %2dh %2dm %2ds ]\n" + + # Log a line in the /tmp log-file; for future cat of summary output + echo $total_seconds, $el_h, $el_m, $el_s \ + | awk -va_msg="${test_tag}" -va_fmt="${fmtstr}" '{printf a_fmt, a_msg, $1, $2, $3, $4}' \ + >> "${test_exec_log_file}" +} + +# ######################################################################## +# Wrapper to run a test w/ parameters, and record test execution metrics +# ######################################################################## +function run_with_timing() { + local test_tag="$1" + shift + + # Starting a new test batch. So inject blank link for this chunk of output + start_seconds=$SECONDS + echo " " + set -x + "$@" + set +x + record_elapsed_time $start_seconds "${test_tag}" +} + +# ######################################################################## +# cat contents of test execution log file, and delete it. +# ######################################################################## +function cat_exec_log_file() { + # Display summary test-execution metrics to stdout from /tmp file + if [ -f "${test_exec_log_file}" ]; then + cat "${test_exec_log_file}" + rm -f "${test_exec_log_file}" + fi + echo " " + echo "$(TZ="America/Los_Angeles" date) End SplinterDB Test Suite Execution." +} + From 1d3f84b6480aa9603026e9022de792ed05e3ab89 Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Fri, 23 Jan 2026 14:38:18 -0800 Subject: [PATCH 03/15] stop using maximize build space --- .github/workflows/run-tests.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f7f6b618..99b9d568 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -33,16 +33,16 @@ jobs: BUILD_MSAN: ${{ endsWith(matrix.compiler_mode, 'msan') && 1 || 0 }} NEWTESTS_FUNCTION: ${{ matrix.newtests_function }} steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - with: - root-reserve-mb: 2048 - swap-size-mb: 1 - remove-dotnet: true - remove-android: true - remove-haskell: true - remove-codeql: true - remove-docker-images: false + # - name: Maximize build space + # uses: easimon/maximize-build-space@master + # with: + # root-reserve-mb: 2048 + # swap-size-mb: 1 + # remove-dotnet: true + # remove-android: true + # remove-haskell: true + # remove-codeql: true + # remove-docker-images: false - uses: actions/checkout@v4 - uses: awalsh128/cache-apt-pkgs-action@latest with: From b2ac90b7f714eb0aef55cf7a5cc393d083ccc861 Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Fri, 23 Jan 2026 16:05:50 -0800 Subject: [PATCH 04/15] stop using maximize build space --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 99b9d568..8513c1c0 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -48,4 +48,4 @@ jobs: with: packages: libxxhash-dev libaio-dev libconfig-dev gcc clang-19 clang-format-19 - name: make ${{ matrix.target }} - run: pwd; make ${{ matrix.target }} + run: df -h; make ${{ matrix.target }} From e58cd98692b8d499f6efac19d77e423d62b02fdf Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Fri, 23 Jan 2026 16:36:41 -0800 Subject: [PATCH 05/15] reenable space maximizer --- .github/workflows/run-tests.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8513c1c0..72e05179 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -33,16 +33,16 @@ jobs: BUILD_MSAN: ${{ endsWith(matrix.compiler_mode, 'msan') && 1 || 0 }} NEWTESTS_FUNCTION: ${{ matrix.newtests_function }} steps: - # - name: Maximize build space - # uses: easimon/maximize-build-space@master - # with: - # root-reserve-mb: 2048 - # swap-size-mb: 1 - # remove-dotnet: true - # remove-android: true - # remove-haskell: true - # remove-codeql: true - # remove-docker-images: false + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 1 + remove-dotnet: true + remove-android: true + remove-haskell: true + remove-codeql: true + remove-docker-images: false - uses: actions/checkout@v4 - uses: awalsh128/cache-apt-pkgs-action@latest with: From 18842709044e3534e0a5c357320c6527d32ad8df Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Fri, 23 Jan 2026 17:00:05 -0800 Subject: [PATCH 06/15] reenable space maximizer --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 72e05179..8b5eb901 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -36,7 +36,7 @@ jobs: - name: Maximize build space uses: easimon/maximize-build-space@master with: - root-reserve-mb: 4096 + root-reserve-mb: 8192 swap-size-mb: 1 remove-dotnet: true remove-android: true From af2e0a848c47e5aa7e96e944331c3dadec9b5f94 Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Fri, 23 Jan 2026 17:07:58 -0800 Subject: [PATCH 07/15] reenable space maximizer --- .github/workflows/run-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8b5eb901..c95bde40 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -36,7 +36,8 @@ jobs: - name: Maximize build space uses: easimon/maximize-build-space@master with: - root-reserve-mb: 8192 + root-reserve-mb: 4096 + temp-reserve-mb: 4096 swap-size-mb: 1 remove-dotnet: true remove-android: true From db7f352f95127bc6c2e956fff6ff4e9bb9e88c6c Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Fri, 23 Jan 2026 21:25:42 -0800 Subject: [PATCH 08/15] try to use my version of space maximizer Signed-off-by: Rob Johnson --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c95bde40..9cb64d27 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -34,7 +34,7 @@ jobs: NEWTESTS_FUNCTION: ${{ matrix.newtests_function }} steps: - name: Maximize build space - uses: easimon/maximize-build-space@master + uses: rtjohnso/maximize-build-space@master with: root-reserve-mb: 4096 temp-reserve-mb: 4096 From aefd65f88b78527bf89f40873e7497f381a068de Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Fri, 23 Jan 2026 22:35:09 -0800 Subject: [PATCH 09/15] fix deadlock in shard_log_write Signed-off-by: Rob Johnson --- src/shard_log.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shard_log.c b/src/shard_log.c index 6b2bae23..2193dec0 100644 --- a/src/shard_log.c +++ b/src/shard_log.c @@ -227,8 +227,10 @@ shard_log_write(log_handle *logh, key tuple_key, message msg, uint64 generation) page = cache_get(cc, thread_data->addr, TRUE, PAGE_TYPE_LOG); uint64 wait = 1; while (!cache_try_claim(cc, page)) { + cache_unget(cc, page); platform_sleep_ns(wait); wait = wait > 1024 ? wait : 2 * wait; + page = cache_get(cc, thread_data->addr, TRUE, PAGE_TYPE_LOG); } cache_lock(cc, page); } From e16a0c778812ba2f86c7bd5aba050496c230b3c3 Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Sat, 24 Jan 2026 22:23:24 -0800 Subject: [PATCH 10/15] make clockcache_get_free_page always succeed Signed-off-by: Rob Johnson --- src/clockcache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/clockcache.c b/src/clockcache.c index e428aad5..65fd95da 100644 --- a/src/clockcache.c +++ b/src/clockcache.c @@ -1223,9 +1223,7 @@ clockcache_get_free_page(clockcache *cc, * not give up after 3 passes on the cache. At least wait for the * max latency of an IO and keep making passes. */ - while (num_passes < 3 - || (blocking && !io_max_latency_elapsed(cc->io, wait_start))) - { + while (num_passes < 3 || blocking) { uint64 start_entry = cc->per_thread[tid].free_hand * CC_ENTRIES_PER_BATCH; uint64 end_entry = start_entry + CC_ENTRIES_PER_BATCH; for (entry_no = start_entry; entry_no < end_entry; entry_no++) { From 8628a65cc5b407b95934491c371324df4103df27 Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Sat, 24 Jan 2026 22:39:55 -0800 Subject: [PATCH 11/15] fix log_test --perf forced failure exit code Signed-off-by: Rob Johnson --- tests/functional/log_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/log_test.c b/tests/functional/log_test.c index 79fcb067..ee8ad0ad 100644 --- a/tests/functional/log_test.c +++ b/tests/functional/log_test.c @@ -320,8 +320,8 @@ log_test(int argc, char *argv[]) if (run_perf_test) { ret = test_log_perf( (cache *)cc, &system_cfg.log_cfg, log, 200000000, &gen, 16, &ts, hid); - rc = -1; platform_assert_status_ok(ret); + rc = 0; } else if (run_crash_test) { rc = test_log_crash(cc, &system_cfg.cache_cfg, From 734441ceca5ca9b0baf3493800957792b5abefca Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Sun, 25 Jan 2026 16:34:35 -0800 Subject: [PATCH 12/15] increase parallelism and reduce waste Signed-off-by: Rob Johnson --- .github/workflows/run-tests.yml | 18 +++++- newtests.sh | 103 +++++++++++++++++++++++--------- 2 files changed, 92 insertions(+), 29 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9cb64d27..bde6ac16 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -22,8 +22,22 @@ jobs: compiler_mode: [gcc, clang, gcc-asan, clang-msan] build_mode: [release, debug] target: [newtests] - newtests_function: [cache_tests, functionality_tests, parallel_perf_tests, perf_tests, splinter_misc_tests, large_insert_stress_tests, misc_tests] - name: ${{ matrix.compiler_mode }} ${{ matrix.build_mode }} ${{ matrix.newtests_function }} + newtests_function: [cache_tests_1, cache_tests_2, cache_tests_3, functionality_tests, parallel_perf_test_1, parallel_perf_test_2, parallel_perf_test_3, parallel_perf_test_4, perf_tests_1, perf_tests_2, splinter_misc_tests_1, splinter_misc_tests_2, large_insert_stress_tests_1, large_insert_stress_tests_2, large_insert_stress_tests_3, misc_tests, filter_tests, unit_tests] + exclude: + - compiler_mode: gcc-asan + build_mode: debug + target: newtests + - compiler_mode: clang-msan + build_mode: debug + target: newtests + include: + - compiler_mode: gcc-asan + build_mode: debug + target: all + - compiler_mode: clang-msan + build_mode: debug + target: all + name: ${{ matrix.compiler_mode }} ${{ matrix.build_mode }} ${{ matrix.target }} ${{ matrix.newtests_function }} runs-on: ubuntu-latest env: CC: ${{ startsWith(matrix.compiler_mode, 'gcc') && 'gcc' || 'clang' }} diff --git a/newtests.sh b/newtests.sh index 5d94c63a..3320f12f 100755 --- a/newtests.sh +++ b/newtests.sh @@ -11,13 +11,10 @@ function run() } # 14 minutes -function cache_tests() { +function cache_tests_1() { # 25 sec each run driver_test cache_test --perf run driver_test cache_test --perf --use-shmem - # 390 sec each - run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 - run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 --use-shmem # 3 sec each run driver_test cache_test --seed 135 run driver_test cache_test --seed 135 --use-shmem @@ -27,6 +24,16 @@ function cache_tests() { } +function cache_tests_2() { + # 390 sec each + run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 +} + +function cache_tests_3() { + # 390 sec each + run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 --use-shmem +} + # 12 minutes function functionality_tests() { # 50 sec each @@ -45,23 +52,40 @@ function functionality_tests() { run driver_test splinter_test --functionality 10000000 1000 --num-tables 2 --cache-capacity-mib 4096 } -# 8 minutes -function parallel_perf_tests() { +function parallel_perf_test_1() { # 115 sec each run driver_test splinter_test --parallel-perf --max-async-inflight 0 --num-pthreads 8 --lookup-positive-percent 10 --tree-size-gib 8 --db-capacity-gib 60 +} + +function parallel_perf_test_2() { + # 115 sec each run driver_test splinter_test --parallel-perf --max-async-inflight 0 --num-pthreads 8 --lookup-positive-percent 10 --tree-size-gib 8 --db-capacity-gib 60 --use-shmem +} + +function parallel_perf_test_3() { + # 115 sec each run driver_test splinter_test --parallel-perf --max-async-inflight 10 --num-pthreads 20 --tree-size-gib 5 --num-normal-bg-threads 20 --num-memtable-bg-threads 2 --db-capacity-gib 60 +} + +function parallel_perf_test_4() { + # 115 sec each run driver_test splinter_test --parallel-perf --max-async-inflight 10 --num-pthreads 20 --tree-size-gib 5 --num-normal-bg-threads 20 --num-memtable-bg-threads 2 --db-capacity-gib 60 } + # 10 minutes -function perf_tests() { +function perf_tests_1() { # 60 sec each run driver_test splinter_test --perf --num-insert-threads 4 --num-lookup-threads 4 --num-inserts 10000 --cache-capacity-mib 512 --num-normal-bg-threads 1 --num-memtable-bg-threads 1 run driver_test splinter_test --perf --num-insert-threads 63 --num-range-lookup-threads 0 --tree-size-gib 1 run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 0 --tree-size-gib 2 --cache-capacity-mib 512 run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 4 --lookup-positive-percent 10 --num-inserts 10000 --cache-capacity-mib 512 --verbose-progress run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 8 --num-lookup-threads 8 --num-range-lookup-threads 8 --lookup-positive-percent 10 --tree-size-gib 4 --db-capacity-gib 60 --verbose-progress +} + +# 10 minutes +function perf_tests_2() { + # 60 sec each run driver_test splinter_test --perf --use-shmem --num-insert-threads 4 --num-lookup-threads 4 --num-inserts 10000 --cache-capacity-mib 512 --num-normal-bg-threads 1 --num-memtable-bg-threads 1 run driver_test splinter_test --perf --use-shmem --num-insert-threads 63 --num-range-lookup-threads 0 --tree-size-gib 1 run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 0 --tree-size-gib 2 --cache-capacity-mib 512 @@ -70,28 +94,53 @@ function perf_tests() { } # 2.5 minutes -function splinter_misc_tests() +function splinter_misc_tests_1() { # 30 sec each run driver_test splinter_test --delete --tree-size-gib 1 run driver_test splinter_test --seq-perf --tree-size-gib 1 run driver_test splinter_test --semiseq-perf --tree-size-gib 1 +} + +function splinter_misc_tests_2() +{ # 60 sec run driver_test splinter_test --periodic --tree-size-gib 1 - } -# 11 minutes -function large_insert_stress_tests() { - # 25, 50, 250 sec each (prob. total of 650 sec for all 6 tests) +function large_insert_stress_tests_1() { + # 25, 50 sec each run unit/large_inserts_stress_test --num-inserts 1000000 run unit/large_inserts_stress_test --num-inserts 2000000 --num-normal-bg-threads 4 --num-memtable-bg-threads 3 - run unit/large_inserts_stress_test --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 run unit/large_inserts_stress_test --use-shmem --num-inserts 1000000 run unit/large_inserts_stress_test --use-shmem --num-inserts 2000000 --num-normal-bg-threads 4 --num-memtable-bg-threads 3 +} + +function large_insert_stress_tests_2() { + # 250 sec + run unit/large_inserts_stress_test --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 +} + +function large_insert_stress_tests_3() { + # 250 sec run unit/large_inserts_stress_test --use-shmem --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 } +function filter_tests() { + # 2 sec each + run driver_test filter_test --seed 135 + run driver_test filter_test --seed 135 --use-shmem + # 255 sec + run driver_test filter_test --perf + +} + +function unit_tests() { + # 40 sec each + run unit_test + run unit_test --use-shmem +} + # 8 minutes function misc_tests() { # 15 sec each @@ -108,12 +157,6 @@ function misc_tests() { run driver_test btree_test --perf --cache-capacity-gib 4 --seed 135 run driver_test btree_test --perf --cache-capacity-gib 4 --seed 135 --use-shmem - # 2 sec each - run driver_test filter_test --seed 135 - run driver_test filter_test --seed 135 --use-shmem - # 255 sec - run driver_test filter_test --perf - # 1 sec each run driver_test log_test --seed 135 run driver_test log_test --seed 135 --use-shmem @@ -130,20 +173,26 @@ function misc_tests() { run unit/splinter_test test_splinter_print_diags run unit/splinter_test --use-shmem test_inserts run unit/splinter_test --use-shmem test_splinter_print_diags - - # 40 sec each - run unit_test - run unit_test --use-shmem } function all_tests() { - cache_tests + cache_tests_1 + cache_tests_2 + cache_tests_3 functionality_tests - parallel_perf_tests - perf_tests + parallel_perf_test_1 + parallel_perf_test_2 + parallel_perf_test_3 + parallel_perf_test_4 + perf_tests_1 + perf_tests_2 splinter_misc_tests - large_insert_stress_tests + large_insert_stress_tests_1 + large_insert_stress_tests_2 + large_insert_stress_tests_3 misc_tests + filter_tests + unit_tests } function main() { From f5956cfb2538edf57db0d04fb7d49f02602d01a9 Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Sun, 25 Jan 2026 22:42:27 -0800 Subject: [PATCH 13/15] clean up list of tests to run Signed-off-by: Rob Johnson --- .github/workflows/run-tests.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bde6ac16..1258c995 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,8 +19,8 @@ jobs: run-test-matrix: strategy: matrix: - compiler_mode: [gcc, clang, gcc-asan, clang-msan] - build_mode: [release, debug] + compiler_mode: [clang-msan, gcc-asan, clang, gcc] + build_mode: [debug, release] target: [newtests] newtests_function: [cache_tests_1, cache_tests_2, cache_tests_3, functionality_tests, parallel_perf_test_1, parallel_perf_test_2, parallel_perf_test_3, parallel_perf_test_4, perf_tests_1, perf_tests_2, splinter_misc_tests_1, splinter_misc_tests_2, large_insert_stress_tests_1, large_insert_stress_tests_2, large_insert_stress_tests_3, misc_tests, filter_tests, unit_tests] exclude: @@ -30,6 +30,19 @@ jobs: - compiler_mode: clang-msan build_mode: debug target: newtests + # The following tests are excluded because they take too long to run with sanitizers + - build_mode: debug + newtests_function: large_insert_stress_tests_2 + - build_mode: debug + newtests_function: large_insert_stress_tests_3 + - compiler_mode: gcc-asan + newtests_function: large_insert_stress_tests_2 + - compiler_mode: gcc-asan + newtests_function: large_insert_stress_tests_3 + - compiler_mode: clang-msan + newtests_function: large_insert_stress_tests_2 + - compiler_mode: clang-msan + newtests_function: large_insert_stress_tests_3 include: - compiler_mode: gcc-asan build_mode: debug From 3c1ce89e7842f00bc32dfc5574a7905048cea90f Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Sun, 25 Jan 2026 23:52:39 -0800 Subject: [PATCH 14/15] restore test.sh Signed-off-by: Rob Johnson --- test.sh | 211 ++++++++++++++++++++++++++------------------------------ 1 file changed, 98 insertions(+), 113 deletions(-) diff --git a/test.sh b/test.sh index 21158485..3c465259 100755 --- a/test.sh +++ b/test.sh @@ -119,7 +119,7 @@ function run_with_timing() { start_seconds=$SECONDS echo " " set -x - echo "$@" + "$@" set +x record_elapsed_time $start_seconds "${test_tag}" } @@ -158,37 +158,80 @@ function cat_exec_log_file() { # We exercise large'ish # of inserts, 100 million, with different cache sizes, # to get some coverage on core functionality in stress workloads. # ############################################################################# -function run_functionality_stress_test() { - local n_mills=$1 - local ntables=$2 - local cache_size_mb=$3 +function nightly_functionality_stress_tests() { + # Future: We want to crank this up to 100 mil rows, but assertions around + # trunk bundle mgmt prevent that. + local n_mills=10 local num_rows=$((n_mills * 1000 * 1000)) local nrows_h="${n_mills} mil" + local ntables=1 local test_name="splinter_test --functionality" - local test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size_mb} MiB cache" - local dbname="splinter_test.functionality.db" + # ---- + local cache_size=4 # GB + local test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} GiB cache" + local dbname="splinter_test.functionality.db" + echo "$Me: Run ${test_name} with ${n_mills} million rows, on ${ntables} tables, with ${cache_size} GiB cache" + run_with_timing "Functionality Stress test ${test_descr}" \ + "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ + --num-tables ${ntables} \ + --cache-capacity-gib ${cache_size} \ + --db-location ${dbname} + rm ${dbname} - echo "$Me: Run ${test_name} with ${n_mills} million rows, on ${ntables} tables, with ${cache_size_mb} MiB cache" + # ---- + ntables=2 + local test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} GiB cache" + local dbname="splinter_test.functionality.db" + echo "$Me: Run ${test_name} with ${n_mills} million rows, on ${ntables} tables, with ${cache_size} GiB cache" run_with_timing "Functionality Stress test ${test_descr}" \ "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ --num-tables ${ntables} \ - --cache-capacity-mib ${cache_size_mb} \ + --cache-capacity-gib ${cache_size} \ --db-location ${dbname} - rm -f ${dbname} -} + rm ${dbname} -function nightly_functionality_stress_tests() { - # Future: We want to crank this up to 100 mil rows, but assertions around - # trunk bundle mgmt prevent that. - # millions_of_rows num_tables cache_size_mb - run_functionality_stress_test 10 1 4096 - run_functionality_stress_test 10 2 4096 - run_functionality_stress_test 1 2 1024 - run_functionality_stress_test 1 4 1024 - run_functionality_stress_test 1 4 512 + # ---- + cache_size=1 # GiB + + # Remove this block once issue #322 is fixed. + n_mills=1 + num_rows=$((n_mills * 1000 * 1000)) + nrows_h="${n_mills} mil" + + test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" + echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with default ${cache_size} GiB cache" + run_with_timing "Functionality Stress test ${test_descr}" \ + "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ + --num-tables ${ntables} \ + --cache-capacity-gib ${cache_size} \ + --db-location ${dbname} + rm ${dbname} + + # ---- + ntables=4 + cache_size=1 # GiB + test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" + echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with default ${cache_size} GiB cache" + run_with_timing "Functionality Stress test ${test_descr}" \ + "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ + --num-tables ${ntables} \ + --cache-capacity-gib ${cache_size} \ + --db-location ${dbname} + rm ${dbname} + + # ---- + cache_size=512 # MiB + test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" + # echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with small ${cache_size} MiB cache" + run_with_timing "Functionality Stress test ${test_descr}" \ + "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ + --num-tables ${ntables} \ + --cache-capacity-mib ${cache_size} \ + --db-location ${dbname} + rm ${dbname} } # ############################################################################# @@ -197,11 +240,6 @@ function nightly_functionality_stress_tests() { # of execution, especially to shake out AIO / thread registration issues. # ############################################################################# function nightly_unit_stress_tests() { - local use_msg= - if [ "$Use_shmem" != "" ]; then - use_msg=", using shared memory" - fi - local n_mills=10 local num_rows=$((n_mills * 1000 * 1000)) local nrows_h="${n_mills} mil" @@ -213,14 +251,14 @@ function nightly_unit_stress_tests() { local test_name=large_inserts_stress_test echo "$Me: Run ${test_name} with ${n_mills} million rows, ${n_threads} threads" - run_with_timing "Large Inserts Stress test ${test_descr}${use_msg}" \ + run_with_timing "Large Inserts Stress test ${test_descr}" \ "$BINDIR"/unit/${test_name} \ $Use_shmem \ --shmem-capacity-gib 8 \ --num-inserts ${num_rows} \ --num-memtable-bg-threads 8 \ --num-normal-bg-threads 20 - rm -f ${dbname} + rm ${dbname} } @@ -270,7 +308,7 @@ function nightly_sync_perf_tests() { --db-location ${dbname} \ --verbose-progress \ ${Use_shmem} - rm -f ${dbname} + rm ${dbname} local npthreads=8 local tree_size=8 # GiB @@ -287,7 +325,7 @@ function nightly_sync_perf_tests() { --db-capacity-gib 60 \ --db-location ${dbname} \ ${Use_shmem} - rm -f ${dbname} + rm ${dbname} # Exercise a case with max # of insert-threads which tripped an assertion # This isn't really a 'perf' test but a regression / stability test exec @@ -304,7 +342,7 @@ function nightly_sync_perf_tests() { --tree-size-gib 1 \ --db-location ${dbname} \ ${Use_shmem} - rm -f ${dbname} + rm ${dbname} } # ############################################################################# @@ -323,7 +361,7 @@ function nightly_cache_perf_tests() { "$BINDIR"/driver_test cache_test --perf \ --db-location ${dbname} \ ${Use_shmem} - rm -f ${dbname} + rm ${dbname} cache_size=6 # GiB test_descr="${cache_size} GiB cache" @@ -334,7 +372,7 @@ function nightly_cache_perf_tests() { --cache-capacity-gib ${cache_size} \ --db-capacity-gib 60 \ ${Use_shmem} - rm -f ${dbname} + rm ${dbname} } # ############################################################################# @@ -360,7 +398,7 @@ function nightly_async_perf_tests() { --num-memtable-bg-threads 2 \ --db-capacity-gib 60 \ --db-location ${dbname} - rm -f ${dbname} + rm ${dbname} } # ############################################################################# @@ -573,12 +611,12 @@ function run_fast_unit_tests() { # shellcheck disable=SC2086 "$BINDIR"/unit/task_system_test $Use_shmem - rm -f splinterdb_unit_tests_db + rm splinterdb_unit_tests_db echo " " # shellcheck disable=SC2086 "$BINDIR"/driver_test io_apis_test $Use_shmem - rm -f db + rm db } # ################################################################## @@ -605,7 +643,7 @@ function run_slower_unit_tests() { # in the program to cough-up an error. # shellcheck disable=SC2086 run_with_timing "${msg}" "$BINDIR"/unit/splinter_test ${Use_shmem} test_inserts - rm -f db + rm db # Use fewer rows for this case, to keep elapsed times of MSAN runs reasonable. msg="Splinter lookups test ${use_msg}" @@ -614,7 +652,7 @@ function run_slower_unit_tests() { # shellcheck disable=SC2086 run_with_timing "${msg}" \ "$BINDIR"/unit/splinter_test ${Use_shmem} --num-inserts ${num_rows} test_lookups - rm -f db + rm db unset VERBOSE @@ -622,7 +660,7 @@ function run_slower_unit_tests() { # shellcheck disable=SC2086 run_with_timing "${msg}" \ "$BINDIR"/unit/splinter_test ${Use_shmem} test_splinter_print_diags - rm -f db + rm db # Test runs w/ default of 1M rows for --num-inserts n_mills=1 @@ -632,7 +670,7 @@ function run_slower_unit_tests() { # shellcheck disable=SC2086 run_with_timing "${msg}" \ "$BINDIR"/unit/large_inserts_stress_test ${Use_shmem} --num-inserts ${num_rows} - rm -f splinterdb_unit_tests_db + rm splinterdb_unit_tests_db # Test runs w/ more inserts and enable bg-threads n_mills=2 @@ -645,7 +683,7 @@ function run_slower_unit_tests() { --num-inserts ${num_rows} \ --num-normal-bg-threads 4 \ --num-memtable-bg-threads 3 - rm -f splinterdb_unit_tests_db + rm splinterdb_unit_tests_db } # ################################################################## @@ -660,13 +698,13 @@ function run_slower_forked_process_tests() { local msg="Splinter tests using default number of forked child processes" run_with_timing "${msg}" "$BINDIR"/unit/splinterdb_forked_child_test - rm -f splinterdb_forked_child_test_db + rm splinterdb_forked_child_test_db num_forked_procs=4 msg="Splinter tests using ${num_forked_procs} forked child processes" run_with_timing "${msg}" "$BINDIR"/unit/splinterdb_forked_child_test \ --num-processes ${num_forked_procs} - rm -f splinterdb_unit_tests_db + rm splinterdb_unit_tests_db # ---- Run large_inserts_stress_test with small configuration as a quick check # using forked child process execution. @@ -678,7 +716,7 @@ function run_slower_forked_process_tests() { --fork-child \ --num-inserts ${num_rows} \ test_seq_key_seq_values_inserts_forked - rm -f splinterdb_unit_tests_db + rm splinterdb_unit_tests_db } # ################################################################## @@ -698,14 +736,14 @@ function run_splinter_functionality_tests() { "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ $Use_shmem \ --key-size ${key_size} --seed "$SEED" - rm -f db + rm db # shellcheck disable=SC2086 run_with_timing "Functionality test, with default key size${use_msg}" \ "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ $Use_shmem \ --seed "$SEED" - rm -f db + rm db # shellcheck disable=SC2086 run_with_timing "Functionality test, default key size, with background threads${use_msg}" \ @@ -713,7 +751,7 @@ function run_splinter_functionality_tests() { $Use_shmem \ --num-normal-bg-threads 4 --num-memtable-bg-threads 2 \ --seed "$SEED" - rm -f db + rm db max_key_size=102 # shellcheck disable=SC2086 @@ -721,7 +759,7 @@ function run_splinter_functionality_tests() { "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ $Use_shmem \ --key-size ${max_key_size} --seed "$SEED" - rm -f db + rm db } # ################################################################## @@ -747,7 +785,7 @@ function run_splinter_perf_tests() { --num-inserts 10000 \ --cache-capacity-mib 512 \ --verbose-progress - rm -f db + rm db # Re-run small perf test configuring background threads. This scenario # validates that we can configure bg- and user-threads in one go. @@ -761,7 +799,7 @@ function run_splinter_perf_tests() { --cache-capacity-mib 512 \ --num-normal-bg-threads 1 \ --num-memtable-bg-threads 1 - rm -f db + rm db # shellcheck disable=SC2086 run_with_timing "Performance test${use_msg}" \ @@ -773,7 +811,7 @@ function run_splinter_perf_tests() { --num-range-lookup-threads 0 \ --tree-size-gib 2 \ --cache-capacity-mib 512 - rm -f db + rm db } # ################################################################## @@ -790,19 +828,19 @@ function run_btree_tests() { "$BINDIR"/driver_test btree_test --key-size ${key_size} \ $Use_shmem \ --seed "$SEED" - rm -f db + rm db # shellcheck disable=SC2086 run_with_timing "BTree test, with default key size${use_msg}" \ "$BINDIR"/driver_test btree_test $Use_shmem --seed "$SEED" - rm -f db + rm db key_size=100 # shellcheck disable=SC2086 run_with_timing "BTree test, key size=${key_size} bytes${use_msg}" \ "$BINDIR"/driver_test btree_test $Use_shmem \ --key-size ${key_size} --seed "$SEED" - rm -f db + rm db # shellcheck disable=SC2086 run_with_timing "BTree Perf test${use_msg}" \ @@ -810,7 +848,7 @@ function run_btree_tests() { --cache-capacity-gib 4 \ --seed "$SEED" \ $Use_shmem - rm -f db + rm db } # ################################################################## @@ -824,17 +862,17 @@ function run_other_driver_tests() { # shellcheck disable=SC2086 run_with_timing "Cache test${use_msg}" \ "$BINDIR"/driver_test cache_test --seed "$SEED" $Use_shmem - rm -f db + rm db # shellcheck disable=SC2086 run_with_timing "Log test${use_msg}" \ "$BINDIR"/driver_test log_test --seed "$SEED" $Use_shmem - rm -f db + rm db # shellcheck disable=SC2086 run_with_timing "Filter test${use_msg}" \ "$BINDIR"/driver_test filter_test --seed "$SEED" $Use_shmem - rm -f db + rm db } # ####################################################################### @@ -855,7 +893,7 @@ function run_tests_with_shared_memory() { # Run all the unit-tests first, to get basic coverage of shared-memory support. run_with_timing "Fast unit tests using shared memory" "$BINDIR"/unit_test "--use-shmem" - rm -f splinterdb_unit_tests_db + rm splinterdb_unit_tests_db # Additional case exercised while developing shared memory support for multi # process execution to verify management of IO-contexts under forked processes @@ -865,7 +903,7 @@ function run_tests_with_shared_memory() { # rm splinterdb_io_apis_test_db Use_shmem="--use-shmem" run_slower_unit_tests - if [ -f "${UNIT_TESTS_DB_DEV}" ]; then rm -f "${UNIT_TESTS_DB_DEV}"; fi + if [ -f "${UNIT_TESTS_DB_DEV}" ]; then rm "${UNIT_TESTS_DB_DEV}"; fi Use_shmem="--use-shmem" run_splinter_functionality_tests @@ -881,59 +919,6 @@ function run_tests_with_shared_memory() { record_elapsed_time ${shmem_tests_run_start} "Tests with shared memory configured" } - -function all_tests() -{ - run_functionality_stress_test 10 1 4096 - run_functionality_stress_test 10 2 4096 - run_functionality_stress_test 1 2 1024 - run_functionality_stress_test 1 4 1024 - run_functionality_stress_test 1 4 512 - - Use_shmem="" nightly_unit_stress_tests - Use_shmem="--use-shmem" nightly_unit_stress_tests - - Use_shmem="" nightly_sync_perf_tests - Use_shmem="--use-shmem" nightly_sync_perf_tests - - Use_shmem="" nightly_cache_perf_tests - Use_shmem="--use-shmem" nightly_cache_perf_tests - - Use_shmem="" nightly_async_perf_tests - Use_shmem="--use-shmem" nightly_async_perf_tests - - set +e - run_with_timing "Check limits, error conditions." nightly_test_limitations - set -e - - run_with_timing "Basic build-and-test tests" test_make_run_tests - - run_with_timing "Smoke tests" run_fast_unit_tests "" - - Use_shmem="--use-shmem" - run_with_timing "Smoke tests using shared memory" run_fast_unit_tests - - Use_shmem="--use-shmem" run_slower_unit_tests - Use_shmem="" run_slower_unit_tests - - Use_shmem="" run_splinter_functionality_tests - - Use_shmem="" run_splinter_perf_tests - - Use_shmem="" run_btree_tests - - Use_shmem="" run_other_driver_tests - - run_with_timing "Fast unit tests using shared memory" "$BINDIR"/unit_test "--use-shmem" - - Use_shmem="--use-shmem" run_slower_unit_tests - - Use_shmem="--use-shmem" run_splinter_functionality_tests - Use_shmem="--use-shmem" run_splinter_perf_tests - Use_shmem="--use-shmem" run_btree_tests - Use_shmem="--use-shmem" run_other_driver_tests -} - # ################################################################## # main() begins here # ################################################################## @@ -1055,7 +1040,7 @@ if [ "$INCLUDE_SLOW_TESTS" == "true" ]; then Use_shmem="" run_slower_unit_tests - if [ -f ${UNIT_TESTS_DB_DEV} ]; then rm -f ${UNIT_TESTS_DB_DEV}; fi + if [ -f ${UNIT_TESTS_DB_DEV} ]; then rm ${UNIT_TESTS_DB_DEV}; fi run_splinter_functionality_tests From 092a555e64fab3482fe7a94ff58b8f59525a18df Mon Sep 17 00:00:00 2001 From: Rob Johnson Date: Mon, 26 Jan 2026 10:23:56 -0800 Subject: [PATCH 15/15] removing old test.sh Signed-off-by: Rob Johnson --- .github/workflows/run-tests.yml | 24 +- Makefile | 5 +- ci/steps.lib.yml | 4 - docs/testing.md | 20 +- docs/unit-testing.md | 8 - newtests.sh | 203 ------ test.sh | 1209 +++++-------------------------- 7 files changed, 184 insertions(+), 1289 deletions(-) delete mode 100755 newtests.sh diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1258c995..db580920 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -21,28 +21,28 @@ jobs: matrix: compiler_mode: [clang-msan, gcc-asan, clang, gcc] build_mode: [debug, release] - target: [newtests] - newtests_function: [cache_tests_1, cache_tests_2, cache_tests_3, functionality_tests, parallel_perf_test_1, parallel_perf_test_2, parallel_perf_test_3, parallel_perf_test_4, perf_tests_1, perf_tests_2, splinter_misc_tests_1, splinter_misc_tests_2, large_insert_stress_tests_1, large_insert_stress_tests_2, large_insert_stress_tests_3, misc_tests, filter_tests, unit_tests] + target: [run-tests] + tests_function: [cache_tests_1, cache_tests_2, cache_tests_3, functionality_tests, parallel_perf_test_1, parallel_perf_test_2, parallel_perf_test_3, parallel_perf_test_4, perf_tests_1, perf_tests_2, splinter_misc_tests_1, splinter_misc_tests_2, large_insert_stress_tests_1, large_insert_stress_tests_2, large_insert_stress_tests_3, misc_tests, filter_tests, unit_tests] exclude: - compiler_mode: gcc-asan build_mode: debug - target: newtests + target: run-tests - compiler_mode: clang-msan build_mode: debug - target: newtests + target: run-tests # The following tests are excluded because they take too long to run with sanitizers - build_mode: debug - newtests_function: large_insert_stress_tests_2 + tests_function: large_insert_stress_tests_2 - build_mode: debug - newtests_function: large_insert_stress_tests_3 + tests_function: large_insert_stress_tests_3 - compiler_mode: gcc-asan - newtests_function: large_insert_stress_tests_2 + tests_function: large_insert_stress_tests_2 - compiler_mode: gcc-asan - newtests_function: large_insert_stress_tests_3 + tests_function: large_insert_stress_tests_3 - compiler_mode: clang-msan - newtests_function: large_insert_stress_tests_2 + tests_function: large_insert_stress_tests_2 - compiler_mode: clang-msan - newtests_function: large_insert_stress_tests_3 + tests_function: large_insert_stress_tests_3 include: - compiler_mode: gcc-asan build_mode: debug @@ -50,7 +50,7 @@ jobs: - compiler_mode: clang-msan build_mode: debug target: all - name: ${{ matrix.compiler_mode }} ${{ matrix.build_mode }} ${{ matrix.target }} ${{ matrix.newtests_function }} + name: ${{ matrix.compiler_mode }} ${{ matrix.build_mode }} ${{ matrix.target }} ${{ matrix.tests_function }} runs-on: ubuntu-latest env: CC: ${{ startsWith(matrix.compiler_mode, 'gcc') && 'gcc' || 'clang' }} @@ -58,7 +58,7 @@ jobs: BUILD_MODE: ${{ matrix.build_mode }} BUILD_ASAN: ${{ endsWith(matrix.compiler_mode, 'asan') && 1 || 0 }} BUILD_MSAN: ${{ endsWith(matrix.compiler_mode, 'msan') && 1 || 0 }} - NEWTESTS_FUNCTION: ${{ matrix.newtests_function }} + TESTS_FUNCTION: ${{ matrix.tests_function }} steps: - name: Maximize build space uses: rtjohnso/maximize-build-space@master diff --git a/Makefile b/Makefile index 98f07709..cb6e7c5f 100644 --- a/Makefile +++ b/Makefile @@ -558,10 +558,7 @@ run-tests: all-tests BINDIR=$(BINDIR) ./test.sh test-results: all-tests - INCLUDE_SLOW_TESTS=true BINDIR=$(BINDIR) ./test.sh 2>&1 | tee ./test-results - -newtests: all-tests - BINDIR=$(BINDIR) ./newtests.sh + BINDIR=$(BINDIR) ./test.sh 2>&1 | tee ./test-results run-examples: all-examples for i in $(EXAMPLES_BINS); do $$i || exit; done diff --git a/ci/steps.lib.yml b/ci/steps.lib.yml index a3d34385..b7f9f064 100644 --- a/ci/steps.lib.yml +++ b/ci/steps.lib.yml @@ -57,8 +57,6 @@ config: run: path: sh args: ["-c", "cd /splinterdb && ./test.sh"] - params: - INCLUDE_SLOW_TESTS: "true" #@ end --- @@ -96,8 +94,6 @@ config: params: CC: #@ compiler LD: #@ compiler - INCLUDE_SLOW_TESTS: #@ str(not quick).lower() - RUN_NIGHTLY_TESTS: #@ str(test_nightly).lower() BUILD_VERBOSE: "1" VERBOSE: "3" diff --git a/docs/testing.md b/docs/testing.md index ef901290..22a89c75 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -7,28 +7,16 @@ _Audience: All users and contributors._ ## Testing Overview -In CI, we execute these tests against the following build modes -- All tests on optimized and debug builds using clang -- All tests on optimized and debug builds using gcc -- All tests using address-sanitizer debug builds using the clang compiler -- All tests using memory-sanitizer debug builds using the gcc compiler -- clang-format checks -- [shellcheck](https://www.shellcheck.net) and shfmt checks run against shell scripts - -To run a small collection of unit-tests to give you a very quick -baseline stability of the library, do: `$ make run-tests` +To run the full test-suite, do: `$ make run-tests` or `$make test-results`. The former runs the tests and outputs the results to the terminal. The `test-results` target generates a file with the test results. The [`make run-tests`](../Makefile#:~:text=run%2Dtests) target invokes the underlying [`test.sh`](../test.sh) script to run quick tests. -To execute a larger set of tests, including functional and performance tests, -you can do one of the following: - +To execute a smaller set of tests, you can do the following: ```shell -$ make test-results -$ INCLUDE_SLOW_TESTS=true make run-tests -$ INCLUDE_SLOW_TESTS=true ./test.sh +$ TESTS_FUNCTION= make ``` +See `test.sh` for valid values for `TESTS_FUNCTION`. In CI, all test execution is driven by the top-level [test.sh](../test.sh) script, which exercises individual build artifacts produced for testing, as diff --git a/docs/unit-testing.md b/docs/unit-testing.md index da6e64da..b0ed189e 100644 --- a/docs/unit-testing.md +++ b/docs/unit-testing.md @@ -73,14 +73,6 @@ unit-test binary with the `--list` argument. ---- ## How To Run unit-tests -Quick **smoke-tests** run of unit tests: `$ make run-tests` - -This runs a small subset of unit tests, which execute very quickly, so that you -get a quick turnaround on the overall stability of your changes. - -You can achieve the same result by executing the following test driver script -[test.sh](../test.sh#:~:text=if%20\[%20"$INCLUDE%5FSLOW%5FTESTS"%20!=%20"true"%20\]): `$ ./test.sh` - To **run** all the unit-test suites: `$ bin/unit_test` To run a specific suite, optionally filtering on a specific test case: diff --git a/newtests.sh b/newtests.sh deleted file mode 100755 index 3320f12f..00000000 --- a/newtests.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/bash - -set -e - -source timing_utils.sh - -function run() -{ - run_with_timing "$*" ${BINDIR}/$@ - rm -f db -} - -# 14 minutes -function cache_tests_1() { - # 25 sec each - run driver_test cache_test --perf - run driver_test cache_test --perf --use-shmem - # 3 sec each - run driver_test cache_test --seed 135 - run driver_test cache_test --seed 135 --use-shmem - - # 8 sec - run driver_test cache_test --async - -} - -function cache_tests_2() { - # 390 sec each - run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 -} - -function cache_tests_3() { - # 390 sec each - run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 --use-shmem -} - -# 12 minutes -function functionality_tests() { - # 50 sec each - run driver_test splinter_test --functionality 1000000 100 --seed 135 - run driver_test splinter_test --functionality 1000000 100 --num-normal-bg-threads 4 --num-memtable-bg-threads 2 --seed 135 - run driver_test splinter_test --functionality 1000000 100 --key-size 102 --seed 135 - run driver_test splinter_test --functionality 1000000 100 --key-size 8 --seed 135 - run driver_test splinter_test --functionality 1000000 100 --use-shmem --seed 135 - run driver_test splinter_test --functionality 1000000 100 --use-shmem --num-normal-bg-threads 4 --num-memtable-bg-threads 2 --seed 135 - run driver_test splinter_test --functionality 1000000 100 --use-shmem --key-size 102 --seed 135 - run driver_test splinter_test --functionality 1000000 100 --use-shmem --key-size 8 --seed 135 - run driver_test splinter_test --functionality 1000000 1000 --num-tables 2 --cache-capacity-mib 1024 - run driver_test splinter_test --functionality 1000000 1000 --num-tables 4 --cache-capacity-mib 1024 - run driver_test splinter_test --functionality 1000000 1000 --num-tables 4 --cache-capacity-mib 512 - run driver_test splinter_test --functionality 10000000 1000 --num-tables 1 --cache-capacity-mib 4096 - run driver_test splinter_test --functionality 10000000 1000 --num-tables 2 --cache-capacity-mib 4096 -} - -function parallel_perf_test_1() { - # 115 sec each - run driver_test splinter_test --parallel-perf --max-async-inflight 0 --num-pthreads 8 --lookup-positive-percent 10 --tree-size-gib 8 --db-capacity-gib 60 -} - -function parallel_perf_test_2() { - # 115 sec each - run driver_test splinter_test --parallel-perf --max-async-inflight 0 --num-pthreads 8 --lookup-positive-percent 10 --tree-size-gib 8 --db-capacity-gib 60 --use-shmem -} - -function parallel_perf_test_3() { - # 115 sec each - run driver_test splinter_test --parallel-perf --max-async-inflight 10 --num-pthreads 20 --tree-size-gib 5 --num-normal-bg-threads 20 --num-memtable-bg-threads 2 --db-capacity-gib 60 -} - -function parallel_perf_test_4() { - # 115 sec each - run driver_test splinter_test --parallel-perf --max-async-inflight 10 --num-pthreads 20 --tree-size-gib 5 --num-normal-bg-threads 20 --num-memtable-bg-threads 2 --db-capacity-gib 60 -} - - -# 10 minutes -function perf_tests_1() { - # 60 sec each - run driver_test splinter_test --perf --num-insert-threads 4 --num-lookup-threads 4 --num-inserts 10000 --cache-capacity-mib 512 --num-normal-bg-threads 1 --num-memtable-bg-threads 1 - run driver_test splinter_test --perf --num-insert-threads 63 --num-range-lookup-threads 0 --tree-size-gib 1 - run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 0 --tree-size-gib 2 --cache-capacity-mib 512 - run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 4 --lookup-positive-percent 10 --num-inserts 10000 --cache-capacity-mib 512 --verbose-progress - run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 8 --num-lookup-threads 8 --num-range-lookup-threads 8 --lookup-positive-percent 10 --tree-size-gib 4 --db-capacity-gib 60 --verbose-progress -} - -# 10 minutes -function perf_tests_2() { - # 60 sec each - run driver_test splinter_test --perf --use-shmem --num-insert-threads 4 --num-lookup-threads 4 --num-inserts 10000 --cache-capacity-mib 512 --num-normal-bg-threads 1 --num-memtable-bg-threads 1 - run driver_test splinter_test --perf --use-shmem --num-insert-threads 63 --num-range-lookup-threads 0 --tree-size-gib 1 - run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 0 --tree-size-gib 2 --cache-capacity-mib 512 - run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 4 --lookup-positive-percent 10 --num-inserts 10000 --cache-capacity-mib 512 --verbose-progress - run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 8 --num-lookup-threads 8 --num-range-lookup-threads 8 --lookup-positive-percent 10 --tree-size-gib 4 --db-capacity-gib 60 --verbose-progress -} - -# 2.5 minutes -function splinter_misc_tests_1() -{ - # 30 sec each - run driver_test splinter_test --delete --tree-size-gib 1 - run driver_test splinter_test --seq-perf --tree-size-gib 1 - run driver_test splinter_test --semiseq-perf --tree-size-gib 1 -} - -function splinter_misc_tests_2() -{ - # 60 sec - run driver_test splinter_test --periodic --tree-size-gib 1 -} - -function large_insert_stress_tests_1() { - # 25, 50 sec each - run unit/large_inserts_stress_test --num-inserts 1000000 - run unit/large_inserts_stress_test --num-inserts 2000000 --num-normal-bg-threads 4 --num-memtable-bg-threads 3 - run unit/large_inserts_stress_test --use-shmem --num-inserts 1000000 - run unit/large_inserts_stress_test --use-shmem --num-inserts 2000000 --num-normal-bg-threads 4 --num-memtable-bg-threads 3 -} - -function large_insert_stress_tests_2() { - # 250 sec - run unit/large_inserts_stress_test --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 -} - -function large_insert_stress_tests_3() { - # 250 sec - run unit/large_inserts_stress_test --use-shmem --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 -} - -function filter_tests() { - # 2 sec each - run driver_test filter_test --seed 135 - run driver_test filter_test --seed 135 --use-shmem - # 255 sec - run driver_test filter_test --perf - -} - -function unit_tests() { - # 40 sec each - run unit_test - run unit_test --use-shmem -} - -# 8 minutes -function misc_tests() { - # 15 sec each - # default: 24 - run driver_test btree_test --seed 135 - run driver_test btree_test --use-shmem --seed 135 - run driver_test btree_test --key-size 8 --seed 135 - run driver_test btree_test --key-size 8 --use-shmem --seed 135 - run driver_test btree_test --key-size 100 --seed 135 - run driver_test btree_test --key-size 100 --use-shmem --seed 135 - - # 17 sec each - # default: 1 (but --perf requires >= 4) - run driver_test btree_test --perf --cache-capacity-gib 4 --seed 135 - run driver_test btree_test --perf --cache-capacity-gib 4 --seed 135 --use-shmem - - # 1 sec each - run driver_test log_test --seed 135 - run driver_test log_test --seed 135 --use-shmem - run driver_test log_test --crash - # 14 sec - run driver_test log_test --perf - - # 12 sec each - run unit/splinter_test --num-inserts 2000000 test_lookups - run unit/splinter_test --use-shmem --num-inserts 2000000 test_lookups - - # 2 sec each - run unit/splinter_test test_inserts - run unit/splinter_test test_splinter_print_diags - run unit/splinter_test --use-shmem test_inserts - run unit/splinter_test --use-shmem test_splinter_print_diags -} - -function all_tests() { - cache_tests_1 - cache_tests_2 - cache_tests_3 - functionality_tests - parallel_perf_test_1 - parallel_perf_test_2 - parallel_perf_test_3 - parallel_perf_test_4 - perf_tests_1 - perf_tests_2 - splinter_misc_tests - large_insert_stress_tests_1 - large_insert_stress_tests_2 - large_insert_stress_tests_3 - misc_tests - filter_tests - unit_tests -} - -function main() { - $NEWTESTS_FUNCTION - cat_exec_log_file -} - -main "$@" diff --git a/test.sh b/test.sh index 3c465259..7fcc11e2 100755 --- a/test.sh +++ b/test.sh @@ -1,1082 +1,207 @@ #!/bin/bash -# ############################################################################## -# test.sh - Driver script to invoke SplinterDB test suites. -# ############################################################################## -Me=$(basename "$0") -set -euo pipefail +set -e -# Location of binaries, which live under $BUILD_ROOT, if set. -build_dir="${BUILD_ROOT:-build}" -build_mode="${BUILD_MODE:-release}" -BINDIR="${BINDIR:-${build_dir}/${build_mode}/bin}" +source timing_utils.sh -# Location of binaries, which live under $BUILD_ROOT, if BINDIR is not set. -# If BINDIR -was- set in the user's env, we need to drive off of that. -# To avoid raising a script error by referencing this variable if it was -# -not-set- we just initialized it above to this value. Thus, if the -# following is true, it means the env-var BINDIR was -not- set already. -if [ "${BINDIR}" == "${build_dir}/${build_mode}/bin" ]; then - - # Fix build-dir path based on BUILD_MODE, if -set-. - build_mode="${BUILD_MODE:-release}" - build_dir="${build_dir}/${build_mode}" - - # If either one of Asan / Msan build options is -set-, fix build-dir path. - build_asan="${BUILD_ASAN:-0}" - build_msan="${BUILD_MSAN:-0}" - if [ "${build_asan}" == "1" ]; then - build_dir="${build_dir}-asan" - elif [ "${build_msan}" == "1" ]; then - build_dir="${build_dir}-msan" - fi - - # Establish bin/ dir-path, to account for the other build parameters - BINDIR="${build_dir}/bin" -fi - -echo "$Me: build_dir='${build_dir}', BINDIR='${BINDIR}'" - -# Top-level env-vars controlling test execution logic. CI sets these, too. -INCLUDE_SLOW_TESTS="${INCLUDE_SLOW_TESTS:-false}" -RUN_NIGHTLY_TESTS="${RUN_NIGHTLY_TESTS:-false}" -RUN_MAKE_TESTS="${RUN_MAKE_TESTS:-false}" - -# Global variable to control memory config. Default is off => Use heap memory -Use_shmem="" - -# Name of /tmp file to record test-execution times -test_exec_log_file="/tmp/${Me}.$$.log" - -# Global, that will be re-set at the start of each test's execution -start_seconds=0 - -# ################################################################## -# Print help / usage -# ################################################################## -function usage() { - - # Computed elapsed hours, mins, seconds from total elapsed seconds - echo "Usage: $Me [--help]" - echo "To run quick smoke tests : ./${Me}" - echo "To run CI-regression tests : INCLUDE_SLOW_TESTS=true ./${Me}" - echo "To run nightly regression tests : RUN_NIGHTLY_TESTS=true ./${Me}" - echo "To run make build-and-test tests : RUN_MAKE_TESTS=true ./${Me}" - echo " " - echo "To run a smaller collection of slow running tests, -name the function that drives the test execution. -Examples:" - echo " INCLUDE_SLOW_TESTS=true ./test.sh run_btree_tests" - echo " INCLUDE_SLOW_TESTS=true ./test.sh run_btree_tests --use-shmem" - echo " INCLUDE_SLOW_TESTS=true ./test.sh nightly_cache_perf_tests" - echo " INCLUDE_SLOW_TESTS=true ./test.sh run_splinter_functionality_tests" - echo " INCLUDE_SLOW_TESTS=true ./test.sh run_splinter_functionality_tests --use-shmem" - echo " INCLUDE_SLOW_TESTS=true ./test.sh run_tests_with_shared_memory" +function run() +{ + run_with_timing "$*" ${BINDIR}/$@ + rm -f db } -# ################################################################## -# Compute elapsed time for full run, and convert to units of h, m, s -# This function also logs a line-entry to a /tmp-file, which will be -# emitted later as a summary report. -# ################################################################## -function record_elapsed_time() { - local start_sec=$1 - local test_tag=$2 +# 14 minutes +function cache_tests_1() { + # 25 sec each + run driver_test cache_test --perf + run driver_test cache_test --perf --use-shmem + # 3 sec each + run driver_test cache_test --seed 135 + run driver_test cache_test --seed 135 --use-shmem - # Computed elapsed hours, mins, seconds from total elapsed seconds - total_seconds=$((SECONDS - start_sec)) - el_h=$((total_seconds / 3600)) - el_m=$((total_seconds % 3600 / 60)) - el_s=$((total_seconds % 60)) + # 8 sec + run driver_test cache_test --async - echo "${Me}: $(TZ="America/Los_Angeles" date) ${test_tag}: ${total_seconds} s [ ${el_h}h ${el_m}m ${el_s}s ]" - - # Construct print format string for use by awk - local fmtstr=": %4ds [ %2dh %2dm %2ds ]\n" - if [ "$RUN_NIGHTLY_TESTS" == "true" ]; then - # Provide wider test-tag for nightly tests which print verbose descriptions - fmtstr="%-105s""${fmtstr}" - elif [ "$INCLUDE_SLOW_TESTS" != "true" ]; then - fmtstr="%-32s""${fmtstr}" - else - fmtstr="%-85s""${fmtstr}" - fi - - # Log a line in the /tmp log-file; for future cat of summary output - echo $total_seconds, $el_h, $el_m, $el_s \ - | awk -va_msg="${test_tag}" -va_fmt="${fmtstr}" '{printf a_fmt, a_msg, $1, $2, $3, $4}' \ - >> "${test_exec_log_file}" } -# ######################################################################## -# Wrapper to run a test w/ parameters, and record test execution metrics -# ######################################################################## -function run_with_timing() { - local test_tag="$1" - shift - - # Starting a new test batch. So inject blank link for this chunk of output - start_seconds=$SECONDS - echo " " - set -x - "$@" - set +x - record_elapsed_time $start_seconds "${test_tag}" +function cache_tests_2() { + # 390 sec each + run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 } -# ######################################################################## -# cat contents of test execution log file, and delete it. -# ######################################################################## -function cat_exec_log_file() { - # Display summary test-execution metrics to stdout from /tmp file - if [ -f "${test_exec_log_file}" ]; then - cat "${test_exec_log_file}" - rm -f "${test_exec_log_file}" - fi - echo " " - echo "$(TZ="America/Los_Angeles" date) End SplinterDB Test Suite Execution." +function cache_tests_3() { + # 390 sec each + run driver_test cache_test --perf --cache-capacity-gib 6 --db-capacity-gib 60 --use-shmem } -# ############################################################################# -# Batch of tests run nightly. These take too long. Some are like -# stress tests, some are performance oriented tests. -# -# ---- NOTE ABOUT STRESS / PERF TEST CONFIG PARAMETERS ---- -# -# The test-execution config / parameters are chosen to get a good coverage of -# a reasonable range of configurations. Some of these require big VMs/machines -# with adequate memory & cores to run cleanly. -# -# **** Testing Hardware requirements for adequate turnaround **** -# - 16 - 32 GiB RAM (or higher) -# - 8 cores, even if they are VMs. Some tests fire up multiple threads -# ############################################################################# - -# ############################################################################# -# Functionality stress test: -# -# We exercise large'ish # of inserts, 100 million, with different cache sizes, -# to get some coverage on core functionality in stress workloads. -# ############################################################################# -function nightly_functionality_stress_tests() { - - # Future: We want to crank this up to 100 mil rows, but assertions around - # trunk bundle mgmt prevent that. - local n_mills=10 - local num_rows=$((n_mills * 1000 * 1000)) - local nrows_h="${n_mills} mil" - - local ntables=1 - local test_name="splinter_test --functionality" - - # ---- - local cache_size=4 # GB - local test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} GiB cache" - local dbname="splinter_test.functionality.db" - echo "$Me: Run ${test_name} with ${n_mills} million rows, on ${ntables} tables, with ${cache_size} GiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-gib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} - - # ---- - ntables=2 - local test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} GiB cache" - local dbname="splinter_test.functionality.db" - echo "$Me: Run ${test_name} with ${n_mills} million rows, on ${ntables} tables, with ${cache_size} GiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-gib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} - - # ---- - cache_size=1 # GiB - - # Remove this block once issue #322 is fixed. - n_mills=1 - num_rows=$((n_mills * 1000 * 1000)) - nrows_h="${n_mills} mil" - - test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" - echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with default ${cache_size} GiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-gib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} - - # ---- - ntables=4 - cache_size=1 # GiB - test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" - echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with default ${cache_size} GiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-gib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} - - # ---- - cache_size=512 # MiB - test_descr="${nrows_h} rows, ${ntables} tables, ${cache_size} MiB cache" - # echo "$Me: Run with ${n_mills} million rows, on ${ntables} tables, with small ${cache_size} MiB cache" - run_with_timing "Functionality Stress test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --functionality ${num_rows} 1000 \ - --num-tables ${ntables} \ - --cache-capacity-mib ${cache_size} \ - --db-location ${dbname} - rm ${dbname} +# 12 minutes +function functionality_tests() { + # 50 sec each + run driver_test splinter_test --functionality 1000000 100 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --num-normal-bg-threads 4 --num-memtable-bg-threads 2 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --key-size 102 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --key-size 8 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --use-shmem --seed 135 + run driver_test splinter_test --functionality 1000000 100 --use-shmem --num-normal-bg-threads 4 --num-memtable-bg-threads 2 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --use-shmem --key-size 102 --seed 135 + run driver_test splinter_test --functionality 1000000 100 --use-shmem --key-size 8 --seed 135 + run driver_test splinter_test --functionality 1000000 1000 --num-tables 2 --cache-capacity-mib 1024 + run driver_test splinter_test --functionality 1000000 1000 --num-tables 4 --cache-capacity-mib 1024 + run driver_test splinter_test --functionality 1000000 1000 --num-tables 4 --cache-capacity-mib 512 + run driver_test splinter_test --functionality 10000000 1000 --num-tables 1 --cache-capacity-mib 4096 + run driver_test splinter_test --functionality 10000000 1000 --num-tables 2 --cache-capacity-mib 4096 } -# ############################################################################# -# Unit Stress Tests - Developed as part of shared-memory support for SplinterDB -# This stress test was very useful to stabilize integration with process-model -# of execution, especially to shake out AIO / thread registration issues. -# ############################################################################# -function nightly_unit_stress_tests() { - local n_mills=10 - local num_rows=$((n_mills * 1000 * 1000)) - local nrows_h="${n_mills} mil" - local dbname="splinterdb_unit_tests_db" - - # ---- - local n_threads=32 - local test_descr="${nrows_h} rows, ${n_threads} threads" - local test_name=large_inserts_stress_test - - echo "$Me: Run ${test_name} with ${n_mills} million rows, ${n_threads} threads" - run_with_timing "Large Inserts Stress test ${test_descr}" \ - "$BINDIR"/unit/${test_name} \ - $Use_shmem \ - --shmem-capacity-gib 8 \ - --num-inserts ${num_rows} \ - --num-memtable-bg-threads 8 \ - --num-normal-bg-threads 20 - rm ${dbname} - +function parallel_perf_test_1() { + # 115 sec each + run driver_test splinter_test --parallel-perf --max-async-inflight 0 --num-pthreads 8 --lookup-positive-percent 10 --tree-size-gib 8 --db-capacity-gib 60 } -# ############################################################################# -# Run through collection of nightly stress tests -# ############################################################################# -function run_nightly_stress_tests() { - - nightly_functionality_stress_tests - Use_shmem="" nightly_unit_stress_tests - Use_shmem="--use-shmem" nightly_unit_stress_tests +function parallel_perf_test_2() { + # 115 sec each + run driver_test splinter_test --parallel-perf --max-async-inflight 0 --num-pthreads 8 --lookup-positive-percent 10 --tree-size-gib 8 --db-capacity-gib 60 --use-shmem } -# ############################################################################# -# Performance stress test: -# -# Exercise two sets of performance-related tests: sync and async -# -# Async-systems are a bit unstable now, so will online them shortly in future. -# ############################################################################# -function nightly_sync_perf_tests() { - local use_msg= - if [ "$Use_shmem" != "" ]; then - use_msg=", using shared memory" - fi - - local dbname="splinter_test.perf.db" - - # Different #s of threads. --perf test runs in phases, where some # of - # threads are setup. Insert / lookup / range-lookups are run in separate - # phases. Then, the threads are destroyed. - local nins_t=8 - local nlookup_t=8 - local nrange_lookup_t=8 - local test_descr="${nins_t} insert, ${nlookup_t} lookup, ${nrange_lookup_t} range lookup threads" - - # ---- - run_with_timing "Performance (sync) test ${test_descr}${use_msg}" \ - "$BINDIR"/driver_test splinter_test --perf \ - --max-async-inflight 0 \ - --num-insert-threads ${nins_t} \ - --num-lookup-threads ${nlookup_t} \ - --num-range-lookup-threads ${nrange_lookup_t} \ - --lookup-positive-percent 10 \ - --tree-size-gib 4 \ - --db-capacity-gib 60 \ - --db-location ${dbname} \ - --verbose-progress \ - ${Use_shmem} - rm ${dbname} - - local npthreads=8 - local tree_size=8 # GiB - test_descr="tree-size ${tree_size} GiB, ${npthreads} pthreads" - dbname="splinter_test.pll_perf.db" - - # shellcheck disable=SC2086 - run_with_timing "Parallel Performance (sync) test ${test_descr}${use_msg}" \ - "$BINDIR"/driver_test splinter_test --parallel-perf \ - --max-async-inflight 0 \ - --num-pthreads ${npthreads} \ - --lookup-positive-percent 10 \ - --tree-size-gib ${tree_size} \ - --db-capacity-gib 60 \ - --db-location ${dbname} \ - ${Use_shmem} - rm ${dbname} - - # Exercise a case with max # of insert-threads which tripped an assertion - # This isn't really a 'perf' test but a regression / stability test exec - nins_t=63 - nrange_lookup_t=0 - test_descr="${nins_t} insert threads" - dbname="splinter_test.max_threads.db" - - # shellcheck disable=SC2086 - run_with_timing "Performance with max-threads ${test_descr}${use_msg}" \ - "$BINDIR"/driver_test splinter_test --perf \ - --num-insert-threads ${nins_t} \ - --num-range-lookup-threads ${nrange_lookup_t} \ - --tree-size-gib 1 \ - --db-location ${dbname} \ - ${Use_shmem} - rm ${dbname} +function parallel_perf_test_3() { + # 115 sec each + run driver_test splinter_test --parallel-perf --max-async-inflight 10 --num-pthreads 20 --tree-size-gib 5 --num-normal-bg-threads 20 --num-memtable-bg-threads 2 --db-capacity-gib 60 } -# ############################################################################# -# Nightly Cache Performance tests with async disabled -# ############################################################################# -function nightly_cache_perf_tests() { - local use_msg= - if [ "$Use_shmem" != "" ]; then - use_msg=", using shared memory" - fi - - local dbname="cache_test.perf.db" - local test_descr="default cache size" - # shellcheck disable=SC2086 - run_with_timing "Cache Performance test, ${test_descr}${use_msg}" \ - "$BINDIR"/driver_test cache_test --perf \ - --db-location ${dbname} \ - ${Use_shmem} - rm ${dbname} - - cache_size=6 # GiB - test_descr="${cache_size} GiB cache" - # shellcheck disable=SC2086 - run_with_timing "Cache Performance test, ${test_descr}${use_msg}" \ - "$BINDIR"/driver_test cache_test --perf \ - --db-location ${dbname} \ - --cache-capacity-gib ${cache_size} \ - --db-capacity-gib 60 \ - ${Use_shmem} - rm ${dbname} +function parallel_perf_test_4() { + # 115 sec each + run driver_test splinter_test --parallel-perf --max-async-inflight 10 --num-pthreads 20 --tree-size-gib 5 --num-normal-bg-threads 20 --num-memtable-bg-threads 2 --db-capacity-gib 60 } -# ############################################################################# -# Nightly Performance tests with async enabled - Currently not being invoked. -# ############################################################################# -function nightly_async_perf_tests() { - # TODO: When these tests are onlined, drop these counts, so that we can run - # on even 8-core machines. Review usage of test-execution params in the - # test_splinter_parallel_perf(), and fix accordingly. - local npthreads=20 - local nbgthreads=20 - local nasync=10 - local tree_size=5 - local test_descr="${npthreads} pthreads,bgt=${nbgthreads},async=${nasync}" - local dbname="splinter_test.perf.db" - run_with_timing "Parallel Async Performance test ${test_descr}" \ - "$BINDIR"/driver_test splinter_test --parallel-perf \ - --max-async-inflight ${nasync} \ - --num-pthreads ${npthreads} \ - --tree-size-gib ${tree_size} \ - --num-normal-bg-threads ${nbgthreads} \ - --num-memtable-bg-threads 2 \ - --db-capacity-gib 60 \ - --db-location ${dbname} - rm ${dbname} +# 10 minutes +function perf_tests_1() { + # 60 sec each + run driver_test splinter_test --perf --num-insert-threads 4 --num-lookup-threads 4 --num-inserts 10000 --cache-capacity-mib 512 --num-normal-bg-threads 1 --num-memtable-bg-threads 1 + run driver_test splinter_test --perf --num-insert-threads 63 --num-range-lookup-threads 0 --tree-size-gib 1 + run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 0 --tree-size-gib 2 --cache-capacity-mib 512 + run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 4 --lookup-positive-percent 10 --num-inserts 10000 --cache-capacity-mib 512 --verbose-progress + run driver_test splinter_test --perf --max-async-inflight 0 --num-insert-threads 8 --num-lookup-threads 8 --num-range-lookup-threads 8 --lookup-positive-percent 10 --tree-size-gib 4 --db-capacity-gib 60 --verbose-progress } -# ############################################################################# -# Run through collection of nightly Performance-oriented tests -# ############################################################################# -function run_nightly_perf_tests() { - nightly_sync_perf_tests - - nightly_cache_perf_tests - - nightly_async_perf_tests -} - -# ############################################################################# -# Method to check that the command actually does fail; Otherwise it's an error. -function run_check_rc() { - echo " " - set +e - "$@" - local rc=$? - set -e - if [ "$rc" -eq 0 ]; then - echo "$Me: Test is expected to fail, but did not:" "$@" - exit 1 - fi -} - -# ################################################################## -# Exercise some common testing programs to validate that certain -# hard-limits are being correctly enforced. These don't change -# very often, so it's sufficient to test them in nightly runs. -# ################################################################## -function nightly_test_limitations() { - - # All these invocations are expected to raise an error. If they - # sneak-through that's a test failure. - run_check_rc "${BINDIR}"/driver_test splinter_test --page-size 1024 - run_check_rc "${BINDIR}"/driver_test splinter_test --page-size 2000 - run_check_rc "${BINDIR}"/driver_test splinter_test --page-size 2048 - run_check_rc "${BINDIR}"/driver_test splinter_test --page-size 8192 - - # Only --extent-size 131072 (i.e. 32 pages/extent) is valid. - run_check_rc "${BINDIR}"/driver_test splinter_test --extent-size 2048 - run_check_rc "${BINDIR}"/driver_test splinter_test --extent-size 4096 - run_check_rc "${BINDIR}"/driver_test splinter_test --extent-size 40960 - run_check_rc "${BINDIR}"/driver_test splinter_test --extent-size 8192 - run_check_rc "${BINDIR}"/driver_test splinter_test --extent-size 135168 - run_check_rc "${BINDIR}"/driver_test splinter_test --extent-size 262144 - - # Validate that test-configs honor min / max key-sizes - run_check_rc "${BINDIR}"/driver_test splinter_test --key-size 0 - run_check_rc "${BINDIR}"/driver_test splinter_test --key-size 7 - run_check_rc "${BINDIR}"/driver_test splinter_test --key-size 122 - run_check_rc "${BINDIR}"/driver_test splinter_test --key-size 200 - - # Invoke help usage; to confirm that it still works. - "${BINDIR}"/driver_test splinter_test --help +# 10 minutes +function perf_tests_2() { + # 60 sec each + run driver_test splinter_test --perf --use-shmem --num-insert-threads 4 --num-lookup-threads 4 --num-inserts 10000 --cache-capacity-mib 512 --num-normal-bg-threads 1 --num-memtable-bg-threads 1 + run driver_test splinter_test --perf --use-shmem --num-insert-threads 63 --num-range-lookup-threads 0 --tree-size-gib 1 + run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 0 --tree-size-gib 2 --cache-capacity-mib 512 + run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 4 --num-lookup-threads 4 --num-range-lookup-threads 4 --lookup-positive-percent 10 --num-inserts 10000 --cache-capacity-mib 512 --verbose-progress + run driver_test splinter_test --perf --use-shmem --max-async-inflight 0 --num-insert-threads 8 --num-lookup-threads 8 --num-range-lookup-threads 8 --lookup-positive-percent 10 --tree-size-gib 4 --db-capacity-gib 60 --verbose-progress } -# ################################################################## -# run_build_and_test -- Driver to exercise build in different modes -# and do basic validation that build succeeded. -# -# This function manages the build output-dirs for different modes -# to enable parallel execution of test-builds. This way, we do not -# clobber build outputs across different build-modes when this test -# below runs 'make clean'. -# ################################################################## -function run_build_and_test() { - - local build_root=$1 - local build_mode=$2 - local asan_mode=$3 - local msan_mode=$4 - - local binroot="${build_mode}" # Will be 'debug' or 'release' - local compiler="gcc" - local outfile="${Me}.${build_mode}" - local san="" - - if [ "${asan_mode}" == 1 ]; then - san="asan" - outfile="${outfile}.${san}" - binroot="${binroot}-${san}" - elif [ "${msan_mode}" == 1 ]; then - san="msan" - outfile="${outfile}.${san}" - binroot="${binroot}-${san}" - compiler="clang" - fi - local bindir="${build_root}/${binroot}/bin" - outfile="${outfile}.out" - echo "${Me}: Test ${build_mode} ${san} build; tail -f $outfile" - - # -------------------------------------------------------------------------- - # Do a build in the requested mode. Some gotchas on this execution: - # - This step will recursively execute this script, so provide env-vars - # that will avoid falling into an endless recursion. - # - Specify a diff build-dir to test out make functionality, so that we - # do not clobber user's existing build/ outputs by 'make clean' - # - Verify that couple of build-artifacts are found in bin/ dir as expected. - # - Just check for the existence of driver_test, but do -not- try to run - # 'driver_test --help', as that command exits with non-zero $rc - # -------------------------------------------------------------------------- - { - INCLUDE_SLOW_TESTS=false \ - RUN_MAKE_TESTS=false \ - BUILD_ROOT=${build_root} \ - BUILD_MODE=${build_mode} \ - CC=${compiler} \ - LD=${compiler} \ - BUILD_ASAN=${asan_mode} \ - BUILD_MSAN=${msan_mode} \ - make all - - echo "${Me}: Basic checks to verify few build artifacts:" - ls -l "${bindir}"/driver_test - "${bindir}"/unit_test --help - "${bindir}"/unit/splinter_test --help - - } >> "${outfile}" 2>&1 -} - -# ################################################################## -# test_make_all_build_modes: Basic sanity verification of builds. -# Test the 'make' interfaces for various build-modes. -# ################################################################## -function test_make_all_build_modes() { - - # clean build root dir, so we can do parallel builds below. - local build_root=$1 - BUILD_ROOT=${build_root} make clean - - set +x - echo "$Me: Test 'make' and ${Me} integration for various build modes." - - local build_modes="release debug optimized-debug" - for build_mode in ${build_modes}; do - # asan msan - run_build_and_test "${build_root}" "${build_mode}" 0 0 & - run_build_and_test "${build_root}" "${build_mode}" 1 0 & - run_build_and_test "${build_root}" "${build_mode}" 0 1 & - done - wait +# 2.5 minutes +function splinter_misc_tests_1() +{ + # 30 sec each + run driver_test splinter_test --delete --tree-size-gib 1 + run driver_test splinter_test --seq-perf --tree-size-gib 1 + run driver_test splinter_test --semiseq-perf --tree-size-gib 1 } -# ################################################################## -# Basic test to verify that the Makefile's config-conflict checks -# are working as designed. -# ################################################################## -function test_make_config_conflicts() { - set +x - local build_root=$1 - BUILD_ROOT=${build_root} make clean - - local outfile="${Me}.config_conflicts.out" - echo "${Me}: test Makefile config-conflict detection ... tail -f ${outfile}" - - # Should succeed - BUILD_ROOT=${build_root} CC=gcc LD=gcc make libs >> "${outfile}" 2>&1 - - # Should also succeed in another build-mode - BUILD_ROOT=${build_root} CC=gcc LD=gcc BUILD_MODE=debug make libs >> "${outfile}" 2>&1 - - # These commands are supposed to fail, so turn this OFF - set +e - BUILD_ROOT=${build_root} CC=clang LD=clang make libs >> "${outfile}" 2>&1 - local rc=$? - if [ "$rc" -eq 0 ]; then - echo "$Me:${LINENO}: Test is expected to fail, but did not." - exit 1 - fi - BUILD_ROOT=${build_root} CC=clang LD=clang BUILD_MODE=debug make libs >> "${outfile}" 2>&1 - local rc=$? - if [ "$rc" -eq 0 ]; then - echo "$Me:${LINENO} Test is expected to fail, but did not." - exit 1 - fi +function splinter_misc_tests_2() +{ + # 60 sec + run driver_test splinter_test --periodic --tree-size-gib 1 } -# ################################################################## -# Driver function to exercise 'make' build-tests -# ################################################################## -function test_make_run_tests() { - local build_root="/tmp/test-builds" - test_make_config_conflicts "${build_root}" - test_make_all_build_modes "${build_root}" - - if [ -d ${build_root} ]; then rm -rf "${build_root}"; fi +function large_insert_stress_tests_1() { + # 25, 50 sec each + run unit/large_inserts_stress_test --num-inserts 1000000 + run unit/large_inserts_stress_test --num-inserts 2000000 --num-normal-bg-threads 4 --num-memtable-bg-threads 3 + run unit/large_inserts_stress_test --use-shmem --num-inserts 1000000 + run unit/large_inserts_stress_test --use-shmem --num-inserts 2000000 --num-normal-bg-threads 4 --num-memtable-bg-threads 3 } -# ################################################################## -# Smoke Tests: Run a small collection of fast-running unit-tests -# This can be invoked w/ or w/o the "--use-shmem" arg. -# ################################################################## -function run_fast_unit_tests() { - - "$BINDIR"/unit/splinterdb_quick_test "$Use_shmem" - "$BINDIR"/unit/btree_test "$Use_shmem" - "$BINDIR"/unit/util_test "$Use_shmem" - "$BINDIR"/unit/misc_test "$Use_shmem" - "$BINDIR"/unit/limitations_test "$Use_shmem" - "$BINDIR"/unit/task_system_test "$Use_shmem" - "$BINDIR"/unit/splinterdb_heap_id_mgmt_test "$Use_shmem" - "$BINDIR"/unit/platform_apis_test "$Use_shmem" - - echo " " - # Just exercise with some combination of background threads to ensure - # that basic usage of background threads still works. - # shellcheck disable=SC2086 - "$BINDIR"/unit/task_system_test $Use_shmem - - rm splinterdb_unit_tests_db - - echo " " - # shellcheck disable=SC2086 - "$BINDIR"/driver_test io_apis_test $Use_shmem - rm db +function large_insert_stress_tests_2() { + # 250 sec + run unit/large_inserts_stress_test --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 } -# ################################################################## -# Run mini-unit-tests that were excluded from bin/unit_test binary: -# Explicitly run individual cases from specific slow running unit-tests, -# where appropriate with a different test-configuration that has been -# found to provide the required coverage. -# Execute this set w/ and w/o the "--use-shmem" arg. -# ################################################################## -function run_slower_unit_tests() { - local use_msg= - if [ "$Use_shmem" != "" ]; then - use_msg="using shared memory" - fi - - local msg="Splinter inserts test ${use_msg}" - - # Turn this ON so we see shared memory usage metrics at shutdown - VERBOSE=7 - export VERBOSE - - # Allow $Use_shmem to come w/o quotes. Otherwise for default execution, we - # end up with empty '' parameter, which causes the argument parsing routine - # in the program to cough-up an error. - # shellcheck disable=SC2086 - run_with_timing "${msg}" "$BINDIR"/unit/splinter_test ${Use_shmem} test_inserts - rm db - - # Use fewer rows for this case, to keep elapsed times of MSAN runs reasonable. - msg="Splinter lookups test ${use_msg}" - local n_mills=2 - local num_rows=$((n_mills * 1000 * 1000)) - # shellcheck disable=SC2086 - run_with_timing "${msg}" \ - "$BINDIR"/unit/splinter_test ${Use_shmem} --num-inserts ${num_rows} test_lookups - rm db - - unset VERBOSE - - msg="Splinter print diagnostics test ${use_msg}" - # shellcheck disable=SC2086 - run_with_timing "${msg}" \ - "$BINDIR"/unit/splinter_test ${Use_shmem} test_splinter_print_diags - rm db - - # Test runs w/ default of 1M rows for --num-inserts - n_mills=1 - num_rows=$((n_mills * 1000 * 1000)) - msg="Large inserts stress test, ${n_mills}M rows, ${use_msg}" - - # shellcheck disable=SC2086 - run_with_timing "${msg}" \ - "$BINDIR"/unit/large_inserts_stress_test ${Use_shmem} --num-inserts ${num_rows} - rm splinterdb_unit_tests_db +function large_insert_stress_tests_3() { + # 250 sec + run unit/large_inserts_stress_test --use-shmem --shmem-capacity-gib 8 --num-inserts 10000000 --num-normal-bg-threads 20 --num-memtable-bg-threads 8 +} + +function filter_tests() { + # 2 sec each + run driver_test filter_test --seed 135 + run driver_test filter_test --seed 135 --use-shmem + # 255 sec + run driver_test filter_test --perf + +} + +function unit_tests() { + # 40 sec each + run unit_test + run unit_test --use-shmem +} + +# 8 minutes +function misc_tests() { + # 15 sec each + # default: 24 + run driver_test btree_test --seed 135 + run driver_test btree_test --use-shmem --seed 135 + run driver_test btree_test --key-size 8 --seed 135 + run driver_test btree_test --key-size 8 --use-shmem --seed 135 + run driver_test btree_test --key-size 100 --seed 135 + run driver_test btree_test --key-size 100 --use-shmem --seed 135 - # Test runs w/ more inserts and enable bg-threads - n_mills=2 - num_rows=$((n_mills * 1000 * 1000)) - msg="Large inserts stress test, ${n_mills}M rows, 7 bg threads ${use_msg}" - # - # shellcheck disable=SC2086 - run_with_timing "${msg}" \ - "$BINDIR"/unit/large_inserts_stress_test ${Use_shmem} \ - --num-inserts ${num_rows} \ - --num-normal-bg-threads 4 \ - --num-memtable-bg-threads 3 - rm splinterdb_unit_tests_db -} - -# ################################################################## -# Run tests that exercise forked-child processes which connect to -# Splinter configured with shared segment memory. -# -# NOTE: Support for shared memory is experimental. Thus, these -# tests exercising execution via forked-processes accessing -# shared memory are also experimental. -# ################################################################## -function run_slower_forked_process_tests() { - - local msg="Splinter tests using default number of forked child processes" - run_with_timing "${msg}" "$BINDIR"/unit/splinterdb_forked_child_test - rm splinterdb_forked_child_test_db - - num_forked_procs=4 - msg="Splinter tests using ${num_forked_procs} forked child processes" - run_with_timing "${msg}" "$BINDIR"/unit/splinterdb_forked_child_test \ - --num-processes ${num_forked_procs} - rm splinterdb_unit_tests_db - - # ---- Run large_inserts_stress_test with small configuration as a quick check - # using forked child process execution. - msg="Splinter large inserts test using shared memory, 1 forked child" - local num_rows=$((2 * 1000 * 1000)) - # shellcheck disable=SC2086 - run_with_timing "${msg}" "$BINDIR"/unit/large_inserts_stress_test \ - --use-shmem \ - --fork-child \ - --num-inserts ${num_rows} \ - test_seq_key_seq_values_inserts_forked - rm splinterdb_unit_tests_db -} - -# ################################################################## -# Execute a few variations of splinter_test --functionality tests -# Execute this set w/ and w/o the "--use-shmem" arg. -# ################################################################## -function run_splinter_functionality_tests() { - - local use_msg= - if [ "$Use_shmem" != "" ]; then - use_msg=", using shared memory" - fi - - key_size=8 - # shellcheck disable=SC2086 - run_with_timing "Functionality test, key size=${key_size} bytes${use_msg}" \ - "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ - $Use_shmem \ - --key-size ${key_size} --seed "$SEED" - rm db - - # shellcheck disable=SC2086 - run_with_timing "Functionality test, with default key size${use_msg}" \ - "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ - $Use_shmem \ - --seed "$SEED" - rm db - - # shellcheck disable=SC2086 - run_with_timing "Functionality test, default key size, with background threads${use_msg}" \ - "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ - $Use_shmem \ - --num-normal-bg-threads 4 --num-memtable-bg-threads 2 \ - --seed "$SEED" - rm db - - max_key_size=102 - # shellcheck disable=SC2086 - run_with_timing "Functionality test, key size=maximum (${max_key_size} bytes)${use_msg}" \ - "$BINDIR"/driver_test splinter_test --functionality 1000000 100 \ - $Use_shmem \ - --key-size ${max_key_size} --seed "$SEED" - rm db -} - -# ################################################################## -# Execute a few variations of splinter_test --perf tests -# Execute this set w/ and w/o the "--use-shmem" arg. -# ################################################################## -function run_splinter_perf_tests() { - local use_msg= - if [ "$Use_shmem" != "" ]; then - use_msg=", using shared memory" - fi - # Validate use of small # of --num-inserts, and --verbose-progress - # Test-case basically is for functional testing of interfaces. - # shellcheck disable=SC2086 - run_with_timing "Very quick Performance test${use_msg}" \ - "$BINDIR"/driver_test splinter_test --perf \ - $Use_shmem \ - --max-async-inflight 0 \ - --num-insert-threads 4 \ - --num-lookup-threads 4 \ - --num-range-lookup-threads 4 \ - --lookup-positive-percent 10 \ - --num-inserts 10000 \ - --cache-capacity-mib 512 \ - --verbose-progress - rm db - - # Re-run small perf test configuring background threads. This scenario - # validates that we can configure bg- and user-threads in one go. - # shellcheck disable=SC2086 - run_with_timing "Quick Performance test with background threads${use_msg}" \ - "$BINDIR"/driver_test splinter_test --perf \ - $Use_shmem \ - --num-insert-threads 4 \ - --num-lookup-threads 4 \ - --num-inserts 10000 \ - --cache-capacity-mib 512 \ - --num-normal-bg-threads 1 \ - --num-memtable-bg-threads 1 - rm db - - # shellcheck disable=SC2086 - run_with_timing "Performance test${use_msg}" \ - "$BINDIR"/driver_test splinter_test --perf \ - $Use_shmem \ - --max-async-inflight 0 \ - --num-insert-threads 4 \ - --num-lookup-threads 4 \ - --num-range-lookup-threads 0 \ - --tree-size-gib 2 \ - --cache-capacity-mib 512 - rm db -} - -# ################################################################## -# Execute BTree tests, including BTree perf test case -# ################################################################## -function run_btree_tests() { - local use_msg= - if [ "$Use_shmem" != "" ]; then - use_msg=", using shared memory" - fi - key_size=8 - # shellcheck disable=SC2086 - run_with_timing "BTree test, key size=${key_size} bytes${use_msg}" \ - "$BINDIR"/driver_test btree_test --key-size ${key_size} \ - $Use_shmem \ - --seed "$SEED" - rm db - - # shellcheck disable=SC2086 - run_with_timing "BTree test, with default key size${use_msg}" \ - "$BINDIR"/driver_test btree_test $Use_shmem --seed "$SEED" - rm db - - key_size=100 - # shellcheck disable=SC2086 - run_with_timing "BTree test, key size=${key_size} bytes${use_msg}" \ - "$BINDIR"/driver_test btree_test $Use_shmem \ - --key-size ${key_size} --seed "$SEED" - rm db - - # shellcheck disable=SC2086 - run_with_timing "BTree Perf test${use_msg}" \ - "$BINDIR"/driver_test btree_test --perf \ - --cache-capacity-gib 4 \ - --seed "$SEED" \ - $Use_shmem - rm db -} - -# ################################################################## -# Run remaining functionality-related tests from driver_test -# ################################################################## -function run_other_driver_tests() { - local use_msg= - if [ "$Use_shmem" != "" ]; then - use_msg=", using shared memory" - fi - # shellcheck disable=SC2086 - run_with_timing "Cache test${use_msg}" \ - "$BINDIR"/driver_test cache_test --seed "$SEED" $Use_shmem - rm db - - # shellcheck disable=SC2086 - run_with_timing "Log test${use_msg}" \ - "$BINDIR"/driver_test log_test --seed "$SEED" $Use_shmem - rm db - - # shellcheck disable=SC2086 - run_with_timing "Filter test${use_msg}" \ - "$BINDIR"/driver_test filter_test --seed "$SEED" $Use_shmem - rm db -} - -# ####################################################################### -# Re-run a collection of tests with shared-memory support enabled. -# We strive to run all the tests that are run in a test execution cycle -# with shared memory enabled. However, certain test execution configurations -# may not still be runnable in this mode. So, we will incrementally online -# remaining tests when they can run successfully in this mode. -# ####################################################################### -function run_tests_with_shared_memory() { - { - echo " " - echo "-- Tests with shared memory configured --" >> "${test_exec_log_file}" - echo " " - } >> "${test_exec_log_file}" - - shmem_tests_run_start=$SECONDS - - # Run all the unit-tests first, to get basic coverage of shared-memory support. - run_with_timing "Fast unit tests using shared memory" "$BINDIR"/unit_test "--use-shmem" - rm splinterdb_unit_tests_db - - # Additional case exercised while developing shared memory support for multi - # process execution to verify management of IO-contexts under forked processes -# run_with_timing "IO APIs test using shared memory and forked child" \ -# "$BINDIR"/driver_test io_apis_test \ -# --use-shmem --fork-child -# rm splinterdb_io_apis_test_db - - Use_shmem="--use-shmem" run_slower_unit_tests - if [ -f "${UNIT_TESTS_DB_DEV}" ]; then rm "${UNIT_TESTS_DB_DEV}"; fi - - Use_shmem="--use-shmem" - run_splinter_functionality_tests - run_splinter_perf_tests - run_btree_tests - run_other_driver_tests - - # These are written to always create shared segment, so --use-shmem arg is - # not needed when invoking them. These tests will fork one or more child - # processes. - #run_slower_forked_process_tests - - record_elapsed_time ${shmem_tests_run_start} "Tests with shared memory configured" -} - -# ################################################################## -# main() begins here -# ################################################################## - -if [ $# -eq 1 ] && [ "$1" == "--help" ]; then - usage - exit 0 -fi - -echo "$Me: $(TZ="America/Los_Angeles" date) Start SplinterDB Test Suite Execution." -set -x - -SEED="${SEED:-135}" - -run_type=" " -if [ "$RUN_NIGHTLY_TESTS" == "true" ]; then - run_type=" Nightly " -fi - -set +x - -# Track total elapsed time for entire test-suite's run -testRunStartSeconds=$SECONDS - -# Initialize test-execution timing log file -echo "$(TZ="America/Los_Angeles" date) **** SplinterDB${run_type}Test Suite Execution Times **** " > "${test_exec_log_file}" -echo >> "${test_exec_log_file}" - -# ------------------------------------------------------------------------ -# Fast-path execution support. You can invoke this script specifying the -# name of one of the functions to execute a specific set of tests. If the -# function takes arguments, pass them on the command-line. This way, one -# can debug script changes to ensure that test-execution still works. -# -# Examples: -# Run BTree functional tests w/default memory configuration: -# INCLUDE_SLOW_TESTS=true ./test.sh run_btree_tests -# -# Run BTree functional tests w/shared memory configuration: -# INCLUDE_SLOW_TESTS=true ./test.sh run_btree_tests --use-shmem -# -# Run slower unit-tests w/default memory configuration: -# INCLUDE_SLOW_TESTS=true ./test.sh run_slower_unit_tests -# -# Run slower unit-tests & nightly stress tests w/shared memory configuration: -# INCLUDE_SLOW_TESTS=true ./test.sh run_slower_unit_tests --use-shmem -# INCLUDE_SLOW_TESTS=true ./test.sh nightly_unit_stress_tests --use-shmem -# -# Run collection of tests designed to exercise shared memory support: -# INCLUDE_SLOW_TESTS=true ./test.sh run_tests_with_shared_memory -# ------------------------------------------------------------------------ -if [ $# -ge 1 ]; then - - execMsg="Test $1" - # Parse memory config arg, if supplied, expecting it will only always be - # '--use-shmem'. Anything else, will trip an execution error. - if [ $# -eq 2 ]; then - Use_shmem="$2" - execMsg="${execMsg}, using shared memory" - fi - - # shellcheck disable=SC2048 - $* - record_elapsed_time ${testRunStartSeconds} "${execMsg}" - cat_exec_log_file - exit 0 -fi - -# -# Fast tests -# - -# For some coverage, exercise --help, --list args for unit test binaries -set -x -"$BINDIR"/unit_test --help -"$BINDIR"/unit_test --list -"$BINDIR"/unit_test --list splinterdb_quick -"$BINDIR"/unit/btree_test --help -"$BINDIR"/unit/splinterdb_quick_test --list -set +x - -# Exercise config-parsing test case. Here, we feed-in a set of -# --config-params that the test code knows to "expect" and validates. -# These options can come in any order. -set -x -run_with_timing "Config-params parsing test" - "$BINDIR"/unit/config_parse_test --log \ - --num-inserts 20 \ - --rough-count-height 11 \ - --stats \ - --verbose-logging \ - --verbose-progress -set +x - -run_with_timing "Smoke tests" run_fast_unit_tests "" - -Use_shmem="--use-shmem" -run_with_timing "Smoke tests using shared memory" run_fast_unit_tests - -if [ "$RUN_MAKE_TESTS" == "true" ]; then - run_with_timing "Basic build-and-test tests" test_make_run_tests -fi - -# -# Slow tests -# - -if [ "$INCLUDE_SLOW_TESTS" == "true" ]; then - - # ---- Rest of the coverage runs included in CI test runs ---- - UNIT_TESTS_DB_DEV="unit_tests_db" - - # Run all the unit-tests first, to get basic coverage - run_with_timing "Fast unit tests" "$BINDIR"/unit_test - - # ------------------------------------------------------------------------ - # Run mini-unit-tests that were excluded from bin/unit_test binary: - # ------------------------------------------------------------------------ - Use_shmem="" - run_slower_unit_tests - - if [ -f ${UNIT_TESTS_DB_DEV} ]; then rm ${UNIT_TESTS_DB_DEV}; fi - - run_splinter_functionality_tests - - run_splinter_perf_tests - - run_btree_tests - - run_other_driver_tests - - record_elapsed_time ${testRunStartSeconds} "Tests without shared memory configured" - # ------------------------------------------------------------------------ - # Re-run a collection of tests using shared-memory. - Use_shmem="--use-shmem" run_tests_with_shared_memory - -fi - -# ---- Nightly Stress and Performance test runs ---- -if [ "$RUN_NIGHTLY_TESTS" == "true" ]; then - - set +e - run_with_timing "Check limits, error conditions." nightly_test_limitations - - run_nightly_stress_tests - - Use_shmem="" run_nightly_perf_tests - Use_shmem="--use-shmem" run_nightly_perf_tests - set -e - - record_elapsed_time ${testRunStartSeconds} "Nightly Stress & Performance Tests" + # 17 sec each + # default: 1 (but --perf requires >= 4) + run driver_test btree_test --perf --cache-capacity-gib 4 --seed 135 + run driver_test btree_test --perf --cache-capacity-gib 4 --seed 135 --use-shmem + + # 1 sec each + run driver_test log_test --seed 135 + run driver_test log_test --seed 135 --use-shmem + run driver_test log_test --crash + # 14 sec + run driver_test log_test --perf + + # 12 sec each + run unit/splinter_test --num-inserts 2000000 test_lookups + run unit/splinter_test --use-shmem --num-inserts 2000000 test_lookups + + # 2 sec each + run unit/splinter_test test_inserts + run unit/splinter_test test_splinter_print_diags + run unit/splinter_test --use-shmem test_inserts + run unit/splinter_test --use-shmem test_splinter_print_diags +} + +function all_tests() { + cache_tests_1 + cache_tests_2 + cache_tests_3 + functionality_tests + parallel_perf_test_1 + parallel_perf_test_2 + parallel_perf_test_3 + parallel_perf_test_4 + perf_tests_1 + perf_tests_2 + splinter_misc_tests_1 + splinter_misc_tests_2 + large_insert_stress_tests_1 + large_insert_stress_tests_2 + large_insert_stress_tests_3 + misc_tests + filter_tests + unit_tests +} + +function main() { + if [ -z "$TESTS_FUNCTION" ]; then + TESTS_FUNCTION="all_tests" + fi + $TESTS_FUNCTION cat_exec_log_file - exit 0 -fi - - - -record_elapsed_time ${testRunStartSeconds} "All Tests" -echo ALL PASSED +} -cat_exec_log_file +main "$@"