aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-11-06 11:08:53 +0100
committerGitHub <noreply@github.com>2023-11-06 11:08:53 +0100
commit90f6a433b4e11d7de99a152d84ea4b0c880d7778 (patch)
treeec4515ede73f62e4217ef73c233ff6b5f0188963
parent40badc9abe05362eb94a163a8fed75627b0a4486 (diff)
parent09bbe3a63e31e89eae587335e60efd189c40f6f0 (diff)
Merge pull request #29243 from vespa-engine/vekterli/target-numdocs-test-must-handle-sanitizers
Make test for target numdocs auto-tuning aware of sanitizers
-rw-r--r--searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
index 7f24dd6f30f..09cec0d6d01 100644
--- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
+++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
@@ -25,6 +25,7 @@
#include <vespa/vespalib/util/hw_info.h>
#include <vespa/vespalib/util/varholder.h>
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/config.h>
#include <map>
#include <thread>
@@ -393,6 +394,15 @@ TEST_FF("require that target numdocs is fixed 1k for indexed mode",
}
}
+constexpr bool target_numdocs_hw_adjustment_is_enabled() noexcept {
+ // Must mirror logic of `use_hw_memory_presized_target_num_docs()` in documentdbconfigmanager.cpp
+#ifndef VESPA_USE_SANITIZER
+ return true;
+#else
+ return false;
+#endif
+}
+
TEST_FF("require that target numdocs follows memory for streaming mode",
ConfigTestFixture("search"),
DocumentDBConfigManager(f1.configId + "/test", "test"))
@@ -401,12 +411,14 @@ TEST_FF("require that target numdocs follows memory for streaming mode",
{
auto config = getDocumentDBConfig(f1, f2, createHwInfoWithMemory(1_Gi));
AllocStrategy strategy = config->get_alloc_config().make_alloc_strategy(SubDbType::READY);
- EXPECT_EQUAL(23342213u, strategy.get_grow_strategy().getMinimumCapacity());
+ const auto expected = target_numdocs_hw_adjustment_is_enabled() ? 23342213u : 1024u;
+ EXPECT_EQUAL(expected, strategy.get_grow_strategy().getMinimumCapacity());
}
{
auto config = getDocumentDBConfig(f1, f2, createHwInfoWithMemory(10_Gi));
AllocStrategy strategy = config->get_alloc_config().make_alloc_strategy(SubDbType::READY);
- EXPECT_EQUAL(233422135u, strategy.get_grow_strategy().getMinimumCapacity());
+ const auto expected = target_numdocs_hw_adjustment_is_enabled() ? 233422135u : 1024u;
+ EXPECT_EQUAL(expected, strategy.get_grow_strategy().getMinimumCapacity());
}
}