summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/index
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-02-13 14:13:20 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-02-13 14:13:20 +0000
commitc123db5020dbe5e05bbb83b12d71b77b69c49b2f (patch)
tree7be0274cf563430ff812fbe5985b4f891b5d3af4 /searchcore/src/tests/proton/index
parente2b02d3b7978d831293d88bc3c75c6582ef9418b (diff)
Move control of internal limits closer to where the limitation is.
Diffstat (limited to 'searchcore/src/tests/proton/index')
-rw-r--r--searchcore/src/tests/proton/index/indexmanager_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp
index 065d95e82fa..7db7231c4e8 100644
--- a/searchcore/src/tests/proton/index/indexmanager_test.cpp
+++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp
@@ -314,6 +314,15 @@ TEST_F(IndexManagerTest, require_that_memory_index_is_flushed)
}
}
+TEST_F(IndexManagerTest, require_that_large_memory_footprint_triggers_urgenflush) {
+ using FlushStats = IndexMaintainer::FlushStats;
+ constexpr size_t G = 1024*1024*1024l;
+ // IndexMaintainer::FlushStats small_15G(15*G, 0, 1, 1);
+ EXPECT_FALSE(IndexFlushTarget(_index_manager->getMaintainer()).needUrgentFlush());
+ EXPECT_FALSE(IndexFlushTarget(_index_manager->getMaintainer(), FlushStats(15*G)).needUrgentFlush());
+ EXPECT_TRUE(IndexFlushTarget(_index_manager->getMaintainer(), FlushStats(17*G)).needUrgentFlush());
+}
+
TEST_F(IndexManagerTest, require_that_multiple_flushes_gives_multiple_indexes)
{
size_t flush_count = 10;