From 786c1a2cc475b31449fed9cd17309b09f89cc22c Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Thu, 1 Oct 2020 10:40:54 -0700 Subject: [PATCH] Reduce the number of iterations in DBTest.FileCreationRandomFailure (#7481) Summary: `DBTest.FileCreationRandomFailure` frequently times out during our continuous test runs. (It's a case of "stress test posing as unit test.") The patch reduces the number of iterations to avoid this. Note that the lower numbers are still sufficient to trigger both flushes and compactions, so test coverage is still the same. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7481 Test Plan: `make check` Reviewed By: riversand963 Differential Revision: D24034712 Pulled By: ltamasi fbshipit-source-id: 8731a9446e5a121a1041b00f0df473b9f714935a --- db/db_test.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/db/db_test.cc b/db/db_test.cc index 7291999e2..0ea4c9484 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -5156,12 +5156,13 @@ TEST_F(DBTest, FileCreationRandomFailure) { DestroyAndReopen(options); Random rnd(301); - const int kCDTKeysPerBuffer = 4; - const int kTestSize = kCDTKeysPerBuffer * 4096; - const int kTotalIteration = 100; + constexpr int kCDTKeysPerBuffer = 4; + constexpr int kTestSize = kCDTKeysPerBuffer * 4096; + constexpr int kTotalIteration = 20; // the second half of the test involves in random failure // of file creation. - const int kRandomFailureTest = kTotalIteration / 2; + constexpr int kRandomFailureTest = kTotalIteration / 2; + std::vector values; for (int i = 0; i < kTestSize; ++i) { values.push_back("NOT_FOUND");