From 2f29991701ee384819add5ac51b20d1a4febc554 Mon Sep 17 00:00:00 2001 From: Zhongyi Xie Date: Tue, 6 Feb 2018 13:54:53 -0800 Subject: [PATCH] split RandomizedHarnessTest more ways Summary: RandomizedHarnessTest enumerates different combinations of test type, compression type, restart interval, etc. For some combinations it takes very long to finish, causing the test to time out in test infrastructure. This PR split the test input into smaller trunks in the hope that they will fit in the timeout window. Another possibility is to reduce `num_entries` of course Closes https://github.com/facebook/rocksdb/pull/3467 Differential Revision: D6910235 Pulled By: miasantreble fbshipit-source-id: 717246ee5d21a8a48ad82d4d9c04f9051a66f07f --- table/table_test.cc | 46 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/table/table_test.cc b/table/table_test.cc index 02cf156d7f..4bdf6ba195 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -2603,17 +2603,49 @@ TEST_F(GeneralTableTest, ApproximateOffsetOfCompressed) { } } -TEST_F(HarnessTest, Randomized0) { - // part 1 out of 2 +// RandomizedHarnessTest is very slow for certain combination of arguments +// Split into 8 pieces to reduce the time individual tests take. +TEST_F(HarnessTest, Randomized1n2) { + // part 1,2 out of 8 const size_t part = 1; - const size_t total = 2; + const size_t total = 8; + RandomizedHarnessTest(part, total); + RandomizedHarnessTest(part+1, total); +} + +TEST_F(HarnessTest, Randomized3n4) { + // part 3,4 out of 8 + const size_t part = 3; + const size_t total = 8; + RandomizedHarnessTest(part, total); + RandomizedHarnessTest(part+1, total); +} + +TEST_F(HarnessTest, Randomized5) { + // part 5 out of 8 + const size_t part = 5; + const size_t total = 8; RandomizedHarnessTest(part, total); } -TEST_F(HarnessTest, Randomized1) { - // part 2 out of 2 - const size_t part = 2; - const size_t total = 2; +TEST_F(HarnessTest, Randomized6) { + // part 6 out of 8 + const size_t part = 6; + const size_t total = 8; + RandomizedHarnessTest(part, total); +} + +TEST_F(HarnessTest, Randomized7) { + // part 7 out of 8 + const size_t part = 7; + const size_t total = 8; + RandomizedHarnessTest(part, total); +} + +TEST_F(HarnessTest, Randomized8) { + // part 8 out of 8 + const size_t part = 8; + const size_t total = 8; RandomizedHarnessTest(part, total); }