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
main
Akanksha Mahajan 4 years ago committed by Facebook GitHub Bot
parent 9f1c84ca47
commit 202605143b
  1. 7
      tools/db_crashtest.py

@ -278,8 +278,11 @@ def finalize_and_sanitize(src_params):
or dest_params["use_direct_reads"] == 1) and \ or dest_params["use_direct_reads"] == 1) and \
not is_direct_io_supported(dest_params["db"]): not is_direct_io_supported(dest_params["db"]):
if is_release_mode(): if is_release_mode():
print("{} does not support direct IO".format(dest_params["db"])) print("{} does not support direct IO. Disabling use_direct_reads and "
sys.exit(1) "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: else:
dest_params["mock_direct_io"] = True dest_params["mock_direct_io"] = True

Loading…
Cancel
Save