diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2021-01-08 11:23:55 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2021-01-08 11:24:45 +0100 |
commit | 8019ed3a72d043df059db1e5ec0b9c581eb3cea7 (patch) | |
tree | 49b51d5ba5fe80c37178198954e97f286a443650 /searchcore/src/tests/proton/index | |
parent | f321c8cb9a6df4bd064c89fb5d8122a4596a9fc8 (diff) |
Reduce test time for searchcore_index_test.
Diffstat (limited to 'searchcore/src/tests/proton/index')
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); } } |