diff options
author | Arnstein Ressem <aressem@gmail.com> | 2017-10-11 23:13:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-11 23:13:26 +0200 |
commit | 94bdbf9f9b117b852b1652ad38936b4ffff814dd (patch) | |
tree | 0458cad64a27556cac97a8e470b570ace4e1c545 /searchcore/src/tests/proton | |
parent | e3dea9daba5b89fab618921a94f9394f8ae9144c (diff) |
Revert "Geirst/add feeding concurrency setting to proton"
Diffstat (limited to 'searchcore/src/tests/proton')
-rw-r--r-- | searchcore/src/tests/proton/documentdb/threading_service_config/CMakeLists.txt | 8 | ||||
-rw-r--r-- | searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp | 66 |
2 files changed, 0 insertions, 74 deletions
diff --git a/searchcore/src/tests/proton/documentdb/threading_service_config/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/threading_service_config/CMakeLists.txt deleted file mode 100644 index 214b5c9b86d..00000000000 --- a/searchcore/src/tests/proton/documentdb/threading_service_config/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchcore_threading_service_config_test_app TEST - SOURCES - threading_service_config_test.cpp - DEPENDS - searchcore_server -) -vespa_add_test(NAME searchcore_threading_service_config_test_app COMMAND searchcore_threading_service_config_test_app) 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 deleted file mode 100644 index 658ebe818eb..00000000000 --- a/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP("threading_service_config_test"); - -#include <vespa/searchcore/config/config-proton.h> -#include <vespa/searchcore/proton/common/hw_info.h> -#include <vespa/searchcore/proton/server/threading_service_config.h> -#include <vespa/vespalib/testkit/testapp.h> - -using namespace proton; -using ProtonConfig = vespa::config::search::core::ProtonConfig; -using ProtonConfigBuilder = vespa::config::search::core::ProtonConfigBuilder; - -struct Fixture { - ProtonConfig cfg; - Fixture(uint32_t baseLineIndexingThreads = 2) - : cfg(makeConfig(baseLineIndexingThreads)) - { - } - ProtonConfig makeConfig(uint32_t baseLineIndexingThreads) { - ProtonConfigBuilder builder; - builder.indexing.threads = baseLineIndexingThreads; - builder.indexing.tasklimit = 500; - builder.indexing.semiunboundtasklimit = 50000; - builder.feeding.concurrency = 0.5; - return builder; - } - ThreadingServiceConfig make(uint32_t cpuCores) { - return ThreadingServiceConfig::make(cfg, HwInfo::Cpu(cpuCores)); - } - void assertIndexingThreads(uint32_t expIndexingThreads, uint32_t cpuCores) { - EXPECT_EQUAL(expIndexingThreads, make(cpuCores).indexingThreads()); - } -}; - -TEST_F("require that indexing threads are set based on cpu cores and feeding concurrency", Fixture) -{ - TEST_DO(f.assertIndexingThreads(2, 1)); - TEST_DO(f.assertIndexingThreads(2, 4)); - TEST_DO(f.assertIndexingThreads(2, 8)); - TEST_DO(f.assertIndexingThreads(2, 12)); - TEST_DO(f.assertIndexingThreads(3, 13)); - TEST_DO(f.assertIndexingThreads(3, 18)); - TEST_DO(f.assertIndexingThreads(4, 19)); - TEST_DO(f.assertIndexingThreads(4, 24)); -} - -TEST_F("require that indexing threads is always >= 1", Fixture(0)) -{ - TEST_DO(f.assertIndexingThreads(1, 0)); -} - -TEST_F("require that default task limit is set", Fixture) -{ - EXPECT_EQUAL(500u, f.make(24).defaultTaskLimit()); -} - -TEST_F("require that semiunbound task limit is scaled based on indexing threads", Fixture) -{ - EXPECT_EQUAL(12500u, f.make(24).semiUnboundTaskLimit()); -} - -TEST_MAIN() -{ - TEST_RUN_ALL(); -} |