diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-13 14:13:20 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-13 14:13:20 +0000 |
commit | c123db5020dbe5e05bbb83b12d71b77b69c49b2f (patch) | |
tree | 7be0274cf563430ff812fbe5985b4f891b5d3af4 /searchcore/src/tests | |
parent | e2b02d3b7978d831293d88bc3c75c6582ef9418b (diff) |
Move control of internal limits closer to where the limitation is.
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r-- | searchcore/src/tests/proton/index/indexmanager_test.cpp | 9 | ||||
-rw-r--r-- | searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp | 9 |
2 files changed, 9 insertions, 9 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; diff --git a/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp b/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp index ff64d614169..23c0269f754 100644 --- a/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp +++ b/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp @@ -89,15 +89,6 @@ TEST("require that we cap configured limits based on available memory") { EXPECT_EQUAL(uint64_t(cfg.maxMemoryGain), LIMIT); } -TEST("require that we cap configured limits based on the absolute 16G limit") { - constexpr uint64_t LIMIT_16G = 16 * ONE_G; - constexpr uint64_t MEM_64G = 64 * ONE_G; - const HwInfo::Memory largeMemory(512 * ONE_G); - auto cfg = MemoryFlushConfigUpdater::convertConfig(getConfig(MEM_64G, MEM_64G, 30), largeMemory); - EXPECT_EQUAL(cfg.maxGlobalMemory, LIMIT_16G); - EXPECT_EQUAL(uint64_t(cfg.maxMemoryGain), LIMIT_16G); -} - TEST_F("require that strategy is updated with normal values if no limits are reached", Fixture) { f.updater.notifyDiskMemUsage(DiskMemUsageState()); |