From 39190588e17e6d45ab3295d9837700de2b5fd98e Mon Sep 17 00:00:00 2001 From: Dhruba Borthakur Date: Tue, 5 Nov 2013 14:05:30 -0800 Subject: [PATCH] Fix failure in rocksdb unit test CompressedCache Summary: The problem was that there was only a single key-value in a block and its compressibility was less than 88%. Rocksdb refuses to compress a block unless its compresses to lesser than 88% of its original size. If a block is not compressed, it does nto get inserted into the compressed block cache. Create the test data so that multiple records fit into the same data block. This increases the compressibility of these data block. Test Plan: ./db_test Reviewers: kailiu, haobo Reviewed By: kailiu CC: leveldb Differential Revision: https://reviews.facebook.net/D13905 --- db/db_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_test.cc b/db/db_test.cc index 0f56a7cd0..aa94f089a 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -1800,7 +1800,7 @@ TEST(DBTest, CompressedCache) { std::string str; for (int i = 0; i < num_iter; i++) { if (i % 4 == 0) { // high compression ratio - str = RandomString(&rnd, 100000); + str = RandomString(&rnd, 1000); } values.push_back(str); ASSERT_OK(Put(Key(i), values[i]));