diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-05-05 15:53:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 15:53:03 +0200 |
commit | f32aded80e93429a376a7c671a8c22ffa2c11ded (patch) | |
tree | e45545a94a34a6de1d8f81ffa43db2e0671809d1 /searchcore/src/tests | |
parent | f1ad2f1270209e107f931e111f6030dd5629d93d (diff) |
Revert "Revert "Balder/refactor flushengine runloop""
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r-- | searchcore/src/tests/proton/flushengine/flushengine_test.cpp | 11 | ||||
-rw-r--r-- | searchcore/src/tests/proton/index/indexmanager_test.cpp | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp index a7efe2952eb..3fdc5a8ce9f 100644 --- a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp +++ b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp @@ -450,6 +450,17 @@ struct Fixture } }; +TEST("require that leaf defaults are sane") { + test::DummyFlushTarget leaf("dummy"); + EXPECT_FALSE(leaf.needUrgentFlush()); + EXPECT_EQUAL(0.0, leaf.get_replay_operation_cost()); + EXPECT_TRUE(IFlushTarget::Priority::NORMAL == leaf.getPriority()); + EXPECT_TRUE(50 == static_cast<int>(IFlushTarget::Priority::NORMAL)); + EXPECT_TRUE(100 == static_cast<int>(IFlushTarget::Priority::HIGH)); + EXPECT_TRUE(IFlushTarget::Priority::NORMAL < IFlushTarget::Priority::HIGH); + EXPECT_TRUE(IFlushTarget::Priority::HIGH > IFlushTarget::Priority::NORMAL); +} + TEST_F("require that strategy controls flush target", Fixture(1, IINTERVAL)) { vespalib::Gate fooG, barG; diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp index 880bf8aa3e0..2f6ebcd967f 100644 --- a/searchcore/src/tests/proton/index/indexmanager_test.cpp +++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp @@ -344,6 +344,10 @@ TEST_F(IndexManagerTest, require_that_large_memory_footprint_triggers_urgent_flu EXPECT_TRUE(IndexFlushTarget(_index_manager->getMaintainer(), FlushStats(17_Gi)).needUrgentFlush()); } +TEST_F(IndexManagerTest, require_that_flush_priority_is_high) { + EXPECT_EQ(IFlushTarget::Priority::HIGH, IndexFlushTarget(_index_manager->getMaintainer()).getPriority()); +} + TEST_F(IndexManagerTest, require_that_multiple_flushes_gives_multiple_indexes) { size_t flush_count = 10; |