diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-08 11:40:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 11:40:09 +0100 |
commit | f55c3c4c32abdec9803c4ad999d2157705dd6fd4 (patch) | |
tree | 6208a863ab79b0b0e163bb3dfabe6180d2e39d85 | |
parent | a8b8d5b954eee5ad0a17447fbe70e46ef5f1edee (diff) | |
parent | 8019ed3a72d043df059db1e5ec0b9c581eb3cea7 (diff) |
Merge pull request #15967 from vespa-engine/toregge/reduce-test-time-for-searchcore-index-test
Reduce test time for searchcore_index_test.
4 files changed, 18 insertions, 13 deletions
diff --git a/searchcore/src/tests/proton/index/CMakeLists.txt b/searchcore/src/tests/proton/index/CMakeLists.txt index 4a5baabe0ee..130ed2e97f4 100644 --- a/searchcore/src/tests/proton/index/CMakeLists.txt +++ b/searchcore/src/tests/proton/index/CMakeLists.txt @@ -9,6 +9,10 @@ vespa_add_executable(searchcore_indexmanager_test_app TEST searchcore_pcommon GTest::GTest ) + +vespa_add_test(NAME searchcore_indexmanager_test_app + COMMAND searchcore_indexmanager_test_app) + vespa_add_executable(searchcore_fusionrunner_test_app TEST SOURCES fusionrunner_test.cpp @@ -17,12 +21,20 @@ vespa_add_executable(searchcore_fusionrunner_test_app TEST searchcore_index searchcore_pcommon ) + +vespa_add_test(NAME searchcore_fusionrunner_test_app + COMMAND searchcore_fusionrunner_test_app) + vespa_add_executable(searchcore_diskindexcleaner_test_app TEST SOURCES diskindexcleaner_test.cpp DEPENDS searchcore_index ) + +vespa_add_test(NAME searchcore_diskindexcleaner_test_app + COMMAND searchcore_diskindexcleaner_test_app) + vespa_add_executable(searchcore_indexcollection_test_app TEST SOURCES indexcollection_test.cpp @@ -30,5 +42,6 @@ vespa_add_executable(searchcore_indexcollection_test_app TEST searchcore_index GTest::GTest ) -vespa_add_test(NAME searchcore_index_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/index_test.sh - DEPENDS searchcore_indexmanager_test_app searchcore_fusionrunner_test_app searchcore_diskindexcleaner_test_app searchcore_indexcollection_test_app) + +vespa_add_test(NAME searchcore_indexcollection_test_app + COMMAND searchcore_indexcollection_test_app) diff --git a/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp b/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp index 86f120aa403..f2f133a10cd 100644 --- a/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp +++ b/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp @@ -27,7 +27,7 @@ public: int Main() override; }; -const string index_dir = "test_data"; +const string index_dir = "diskindexcleaner_test_data"; void removeTestData() { FastOS_FileInterface::EmptyAndRemoveDirectory(index_dir.c_str()); diff --git a/searchcore/src/tests/proton/index/index_test.sh b/searchcore/src/tests/proton/index/index_test.sh deleted file mode 100755 index 5cffb9838da..00000000000 --- a/searchcore/src/tests/proton/index/index_test.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e - -$VALGRIND ./searchcore_diskindexcleaner_test_app -$VALGRIND ./searchcore_fusionrunner_test_app -$VALGRIND ./searchcore_indexcollection_test_app -$VALGRIND ./searchcore_indexmanager_test_app diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp index 0589bdbda96..5ce4a1e949d 100644 --- a/searchcore/src/tests/proton/index/indexmanager_test.cpp +++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp @@ -303,14 +303,14 @@ TEST_F(IndexManagerTest, require_that_memory_index_is_flushed) EXPECT_EQ(seconds(stat._modifiedTime), duration_cast<seconds>(target.getLastFlushTime().time_since_epoch())); // updated serial number & flush time when nothing to flush - std::this_thread::sleep_for(8s); + std::this_thread::sleep_for(2s); std::chrono::seconds now = duration_cast<seconds>(vespalib::system_clock::now().time_since_epoch()); vespalib::Executor::Task::UP task; runAsMaster([&]() { task = target.initFlush(2, std::make_shared<search::FlushToken>()); }); EXPECT_FALSE(task); EXPECT_EQ(2u, target.getFlushedSerialNum()); EXPECT_LT(seconds(stat._modifiedTime), duration_cast<seconds>(target.getLastFlushTime().time_since_epoch())); - EXPECT_NEAR(now.count(), duration_cast<seconds>(target.getLastFlushTime().time_since_epoch()).count(), 8); + EXPECT_NEAR(now.count(), duration_cast<seconds>(target.getLastFlushTime().time_since_epoch()).count(), 2); } } |