From dbeaa0d397fd2d26e105817242782024d1e607b7 Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Thu, 12 Jul 2018 14:39:07 -0700 Subject: [PATCH] Reduce #iterations to shorten execution time. (#4123) Summary: Reduce #iterations from 5000 to 1000 so that `ExternalSSTFileTest.CompactDuringAddFileRandom` can finish faster. On the one hand, 5000 iterations does not seem to improve the quality of unit test in comparison with 1000. On the other hand, long running tests should belong to stress tests. Pull Request resolved: https://github.com/facebook/rocksdb/pull/4123 Differential Revision: D8822514 Pulled By: riversand963 fbshipit-source-id: 0f439b8d5ccd9a4aed84638f8bac16382de17245 --- db/external_sst_file_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/external_sst_file_test.cc b/db/external_sst_file_test.cc index dc2ac5b11..046422eb1 100644 --- a/db/external_sst_file_test.cc +++ b/db/external_sst_file_test.cc @@ -1194,8 +1194,9 @@ TEST_F(ExternalSSTFileTest, CompactDuringAddFileRandom) { ASSERT_OK(GenerateAndAddExternalFile(options, file_keys, range_id)); }; + const int num_of_ranges = 1000; std::vector threads; - while (range_id < 5000) { + while (range_id < num_of_ranges) { int range_start = range_id * 10; int range_end = range_start + 10; @@ -1220,7 +1221,7 @@ TEST_F(ExternalSSTFileTest, CompactDuringAddFileRandom) { range_id++; } - for (int rid = 0; rid < 5000; rid++) { + for (int rid = 0; rid < num_of_ranges; rid++) { int range_start = rid * 10; int range_end = range_start + 10;