diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-01-14 11:54:53 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-01-18 14:38:23 +0000 |
commit | aeb3ab8725ee058c65036d582155edc20eff654b (patch) | |
tree | 216f666d0a69da61a0c9053b806e00762319671c /searchcore/src/tests/proton/documentdb/threading_service_config | |
parent | 68da7d45fc5b6e6686963aed4432107a20c74b1f (diff) |
Wire in control of whether taskLimit is hard.
Diffstat (limited to 'searchcore/src/tests/proton/documentdb/threading_service_config')
-rw-r--r-- | searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp b/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp index a59b3e9bc6f..fc8bd474813 100644 --- a/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp +++ b/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp @@ -14,11 +14,11 @@ using ProtonConfigBuilder = vespa::config::search::core::ProtonConfigBuilder; struct Fixture { ProtonConfig cfg; - Fixture(uint32_t baseLineIndexingThreads = 2, uint32_t master_task_limit = 2000, uint32_t task_limit = 500) + Fixture(uint32_t baseLineIndexingThreads = 2, uint32_t master_task_limit = 2000, int32_t task_limit = 500) : cfg(makeConfig(baseLineIndexingThreads, master_task_limit, task_limit)) { } - ProtonConfig makeConfig(uint32_t baseLineIndexingThreads, uint32_t master_task_limit, uint32_t task_limit) { + ProtonConfig makeConfig(uint32_t baseLineIndexingThreads, uint32_t master_task_limit, int32_t task_limit) { ProtonConfigBuilder builder; builder.indexing.threads = baseLineIndexingThreads; builder.indexing.tasklimit = task_limit; @@ -56,6 +56,15 @@ TEST_F("require that task limits are set", Fixture) auto tcfg = f.make(24); EXPECT_EQUAL(2000u, tcfg.master_task_limit()); EXPECT_EQUAL(500u, tcfg.defaultTaskLimit()); + EXPECT_TRUE(tcfg.is_task_limit_hard()); +} + +TEST_F("require that negative task limit makes it soft", Fixture(2, 3000, -700)) +{ + auto tcfg = f.make(24); + EXPECT_EQUAL(3000u, tcfg.master_task_limit()); + EXPECT_EQUAL(700u, tcfg.defaultTaskLimit()); + EXPECT_FALSE(tcfg.is_task_limit_hard()); } namespace { |