From 202605143b7c4f0b06ce3eb3dc63d39d0520c265 Mon Sep 17 00:00:00 2001 From: Akanksha Mahajan Date: Tue, 10 Nov 2020 10:48:46 -0800 Subject: [PATCH] Fix crash test to run in DEBUG_LEVEL=0 mode in tmpfs (#7643) Summary: crash tests donot run in DEBUG_MODE=0 on tmpfs when use_direct_reads/use_direct_io_for_flush_and_compaction is set randomly because direct I/O is not supported on tmpfs and tests exit. Fix: Sanitize direct I/O read options in DEBUG_LEVEL=0 so that crash tests can run in tmpfs. When mmap_reads is set, direct I/O reads options are unset so we can sanitize direct I/O reads options in case of tmpfs as well. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7643 Test Plan: 1. export DEBUG_LEVEL=0; export TEST_TMPDIR="/dev/shm"; export CRASH_TEST_EXT_ARGS="--use_direct_reads=1 --mmap_read=0"; make crash_test -j64 2. In DEBUG_LEVEL=1 mode: make crash_test -j64 Reviewed By: jay-zhuang Differential Revision: D24766550 Pulled By: akankshamahajan15 fbshipit-source-id: 021720b2343c12c72004f84b26147625d3991d9e --- tools/db_crashtest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 4d41e1d2a..b32f21227 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -278,8 +278,11 @@ def finalize_and_sanitize(src_params): or dest_params["use_direct_reads"] == 1) and \ not is_direct_io_supported(dest_params["db"]): if is_release_mode(): - print("{} does not support direct IO".format(dest_params["db"])) - sys.exit(1) + print("{} does not support direct IO. Disabling use_direct_reads and " + "use_direct_io_for_flush_and_compaction.\n".format( + dest_params["db"])) + dest_params["use_direct_reads"] = 0 + dest_params["use_direct_io_for_flush_and_compaction"] = 0 else: dest_params["mock_direct_io"] = True