From 1d8fdfa0e293ebfa9b20a00f079cb88a909b3caf Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Mon, 14 Dec 2015 18:19:40 +0100 Subject: [PATCH 1/2] Since the memory issue is fixed now (using a compressed block store), we can re-enable the test cases --- test/implementations/onblocks/BigBlobsTest.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/test/implementations/onblocks/BigBlobsTest.cpp b/test/implementations/onblocks/BigBlobsTest.cpp index 46b63063..c9029426 100644 --- a/test/implementations/onblocks/BigBlobsTest.cpp +++ b/test/implementations/onblocks/BigBlobsTest.cpp @@ -37,8 +37,7 @@ constexpr size_t BigBlobsTest::BLOCKSIZE; constexpr uint64_t BigBlobsTest::SMALL_BLOB_SIZE; constexpr uint64_t BigBlobsTest::LARGE_BLOB_SIZE; -// DISABLED, because it uses a lot of memory -TEST_F(BigBlobsTest, DISABLED_Resize) { +TEST_F(BigBlobsTest, Resize) { //These operations are in one test case and not in many small ones, because it takes quite long to create a >4GB blob. //Resize to >4GB @@ -75,8 +74,7 @@ TEST_F(BigBlobsTest, DISABLED_Resize) { blobStore->remove(std::move(blob)); } -// DISABLED, because it uses a lot of memory -TEST_F(BigBlobsTest, DISABLED_GrowByWriting_Crossing4GBBorder) { +TEST_F(BigBlobsTest, GrowByWriting_Crossing4GBBorder) { Data fixture = DataFixture::generate(2*(LARGE_BLOB_SIZE-SMALL_BLOB_SIZE)); blob->write(fixture.data(), SMALL_BLOB_SIZE, fixture.size()); @@ -87,8 +85,7 @@ TEST_F(BigBlobsTest, DISABLED_GrowByWriting_Crossing4GBBorder) { EXPECT_EQ(0, std::memcmp(loaded.data(), fixture.data(), loaded.size())); } -// DISABLED, because it uses a lot of memory -TEST_F(BigBlobsTest, DISABLED_GrowByWriting_Outside4GBBorder_StartingSizeZero) { +TEST_F(BigBlobsTest, GrowByWriting_Outside4GBBorder_StartingSizeZero) { Data fixture = DataFixture::generate(1024); blob->write(fixture.data(), LARGE_BLOB_SIZE, fixture.size()); @@ -99,8 +96,7 @@ TEST_F(BigBlobsTest, DISABLED_GrowByWriting_Outside4GBBorder_StartingSizeZero) { EXPECT_EQ(0, std::memcmp(loaded.data(), fixture.data(), loaded.size())); } -// DISABLED, because it uses a lot of memory -TEST_F(BigBlobsTest, DISABLED_GrowByWriting_Outside4GBBorder_StartingSizeOutside4GBBorder) { +TEST_F(BigBlobsTest, GrowByWriting_Outside4GBBorder_StartingSizeOutside4GBBorder) { blob->resize(LARGE_BLOB_SIZE); Data fixture = DataFixture::generate(1024); blob->write(fixture.data(), LARGE_BLOB_SIZE+1024, fixture.size()); @@ -112,8 +108,7 @@ TEST_F(BigBlobsTest, DISABLED_GrowByWriting_Outside4GBBorder_StartingSizeOutside EXPECT_EQ(0, std::memcmp(loaded.data(), fixture.data(), loaded.size())); } -// DISABLED, because it uses a lot of memory -TEST_F(BigBlobsTest, DISABLED_ReadWriteAfterGrown_Crossing4GBBorder) { +TEST_F(BigBlobsTest, ReadWriteAfterGrown_Crossing4GBBorder) { blob->resize(LARGE_BLOB_SIZE+(LARGE_BLOB_SIZE-SMALL_BLOB_SIZE)+1024); Data fixture = DataFixture::generate(2*(LARGE_BLOB_SIZE-SMALL_BLOB_SIZE)); blob->write(fixture.data(), SMALL_BLOB_SIZE, fixture.size()); @@ -125,8 +120,7 @@ TEST_F(BigBlobsTest, DISABLED_ReadWriteAfterGrown_Crossing4GBBorder) { EXPECT_EQ(0, std::memcmp(loaded.data(), fixture.data(), loaded.size())); } -// DISABLED, because it uses a lot of memory -TEST_F(BigBlobsTest, DISABLED_ReadWriteAfterGrown_Outside4GBBorder) { +TEST_F(BigBlobsTest, ReadWriteAfterGrown_Outside4GBBorder) { blob->resize(LARGE_BLOB_SIZE+2048); Data fixture = DataFixture::generate(1024); blob->write(fixture.data(), LARGE_BLOB_SIZE, fixture.size()); From 1337e2db4b8cd0c8e5c7a64eec2ffd0b5a3f7b23 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Mon, 14 Dec 2015 18:48:11 +0100 Subject: [PATCH 2/2] Reduce memory consumption of BibBlogsTest further --- test/implementations/onblocks/BigBlobsTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/implementations/onblocks/BigBlobsTest.cpp b/test/implementations/onblocks/BigBlobsTest.cpp index c9029426..49b60eca 100644 --- a/test/implementations/onblocks/BigBlobsTest.cpp +++ b/test/implementations/onblocks/BigBlobsTest.cpp @@ -22,8 +22,8 @@ using blockstore::compressing::RunLengthEncoding; class BigBlobsTest : public ::testing::Test { public: static constexpr size_t BLOCKSIZE = 32 * 1024; - static constexpr uint64_t SMALL_BLOB_SIZE = UINT64_C(1024)*1024*1024*3.5; // 3.5 GB (<4GB) - static constexpr uint64_t LARGE_BLOB_SIZE = UINT64_C(1024)*1024*1024*4.5; // 4.5 GB (>4GB) + static constexpr uint64_t SMALL_BLOB_SIZE = UINT64_C(1024)*1024*1024*3.9; // 3.9 GB (<4GB) + static constexpr uint64_t LARGE_BLOB_SIZE = UINT64_C(1024)*1024*1024*4.1; // 4.1 GB (>4GB) static constexpr uint64_t max_uint_32 = std::numeric_limits::max(); static_assert(SMALL_BLOB_SIZE < max_uint_32, "LARGE_BLOB_SIZE should need 64bit or the test case is mute");