From e930ba1d18c83a241b4dc77b23d4b3c152d73b86 Mon Sep 17 00:00:00 2001 From: sdong Date: Tue, 14 Jul 2020 15:31:57 -0700 Subject: [PATCH] Run a subset of TSAN tests in CIrcleCI (#7122) Summary: It is helpful to add some TSAN coverage before a pull request is committed. This diff adds some of them. Some slow tests are excluded for the running speed. Some are blacklisted because they show warnings. Will investigate these warnings and see whether we can fix or suppress them. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7122 Test Plan: Watch CIrcleCI runs Reviewed By: riversand963 Differential Revision: D22532133 fbshipit-source-id: 81ddd02d9df19c513a12811979e8ddabae911354 --- .circleci/config.yml | 16 ++++++++++++++++ Makefile | 2 ++ 2 files changed, 18 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 97edc89a7c..c462c65dd9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,6 +97,19 @@ jobs: - run: sudo apt-get update -y && sudo apt-get install -y clang-10 libgflags-dev - run: SKIP_FORMAT_BUCK_CHECKS=1 COMPILE_WITH_ASAN=1 CC=clang-10 CXX=clang++-10 ROCKSDB_DISABLE_ALIGNED_NEW=1 USE_CLANG=1 PRINT_PARALLEL_OUTPUTS=1 make V=1 -j32 check | .circleci/cat_ignore_eagain # aligned new doesn't work for reason we haven't figured out + build-linux-clang10-mini-tsan: + machine: + image: ubuntu-1604:201903-01 + resource_class: 2xlarge + steps: + - checkout # check out the code in the project directory + - run: pyenv global 3.5.2 + - run: echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" | sudo tee -a /etc/apt/sources.list + - run: echo "deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" | sudo tee -a /etc/apt/sources.list + - run: sudo apt-get update -y && sudo apt-get install -y clang-10 libgflags-dev + - run: SKIP_FORMAT_BUCK_CHECKS=1 COMPILE_WITH_TSAN=1 CC=clang-10 CXX=clang++-10 ROCKSDB_DISABLE_ALIGNED_NEW=1 USE_CLANG=1 PRINT_PARALLEL_OUTPUTS=1 EXCLUDE_TESTS_REGEX="DBTestCompactionFilterWithCompactParam.CompactionFilterWithValueChang|DBTestRandomized/DBTestRandomized.Randomized|DBTestWithParam.MergeCompactionTimeTest|DBTestUniversalCompaction.UniversalCompactionTrivialMoveTest1|DBTestUniversalCompactionMultiLevels.UniversalCompactionMultiLevels|ExternalSSTFileTest.IngestFileWithGlobalSeqnoRandomized|ReadaheadSequentialFileTest|ReadExceedsReadaheadSize/ReadaheadSequentialFileTest|TransactionStressTest|MySQLStyleTransactionTest|SnapshotConcurrentAccessTest|eqAdvanceConcurrentTest|WritePreparedTransactionTest|WriteUnpreparedTransactionTest|WriteUnpreparedStressTest|MultiThreadedDBTest|LogMarkLeakTest" make V=1 -j32 check | .circleci/cat_ignore_eagain # aligned new doesn't work for reason we haven't figured out. Exclude some tests to speed up. MultiThreadedDBTest, TransactionStressTest, TransactionStressTest, TransactionStressTest and TransactionStressTest are showing TSAN warning so excluding them for now. Will investigate later. + + build-linux-clang10-ubsan: machine: image: ubuntu-1604:201903-01 @@ -242,6 +255,9 @@ workflows: build-linux-clang10-asan: jobs: - build-linux-clang10-asan + build-linux-clang10-mini-tsan: + jobs: + - build-linux-clang10-mini-tsan build-linux-clang10-ubsan: jobs: - build-linux-clang10-ubsan diff --git a/Makefile b/Makefile index 9a5da537b8..6501ea7595 100644 --- a/Makefile +++ b/Makefile @@ -826,6 +826,7 @@ J ?= 100% # Use this regexp to select the subset of tests whose names match. tests-regexp = . +EXCLUDE_TESTS_REGEX ?= "^$" ifeq ($(PRINT_PARALLEL_OUTPUTS), 1) parallel_com = '{}' @@ -846,6 +847,7 @@ check_0: } \ | $(prioritize_long_running_tests) \ | grep -E '$(tests-regexp)' \ + | grep -E -v '$(EXCLUDE_TESTS_REGEX)' \ | build_tools/gnu_parallel -j$(J) --plain --joblog=LOG $$eta --gnu $(parallel_com) ; \ parallel_retcode=$$? ; \ awk '{ if ($$7 != 0 || $$8 != 0) { if ($$7 == "Exitval") { h = $$0; } else { if (!f) print h; print; f = 1 } } } END { if(f) exit 1; }' < LOG ; \