aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/documentdb
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-02-21 18:59:31 +0100
committerGitHub <noreply@github.com>2022-02-21 18:59:31 +0100
commit9d83cff2851b2126700b1b3cf7b4080ac7c8fb81 (patch)
tree49b08e0b66fdec37bce82643b5c310db0cb41a7b /searchcore/src/tests/proton/documentdb
parenta7e8bb9dcf3c674a3756e0f0383384593856415a (diff)
Revert "Use a common FNET_Transport owned by Proton in both SceduledExecutor …"
Diffstat (limited to 'searchcore/src/tests/proton/documentdb')
-rw-r--r--searchcore/src/tests/proton/documentdb/CMakeLists.txt1
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt1
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp29
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp6
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp6
-rw-r--r--searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp44
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp5
7 files changed, 39 insertions, 53 deletions
diff --git a/searchcore/src/tests/proton/documentdb/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/CMakeLists.txt
index d36368a8ebd..8ebeaef9a99 100644
--- a/searchcore/src/tests/proton/documentdb/CMakeLists.txt
+++ b/searchcore/src/tests/proton/documentdb/CMakeLists.txt
@@ -3,7 +3,6 @@ vespa_add_executable(searchcore_documentdb_test_app TEST
SOURCES
documentdb_test.cpp
DEPENDS
- searchcore_test
searchcore_server
searchcore_initializer
searchcore_reprocessing
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt
index 2706d183988..0bc1235bb6f 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt
@@ -3,7 +3,6 @@ vespa_add_executable(searchcore_document_subdbs_test_app TEST
SOURCES
document_subdbs_test.cpp
DEPENDS
- searchcore_test
searchcore_server
searchcore_initializer
searchcore_reprocessing
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 6e20d30fb36..b9e3549053a 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -25,7 +25,6 @@
#include <vespa/searchcore/proton/server/reconfig_params.h>
#include <vespa/searchcore/proton/matching/querylimiter.h>
#include <vespa/searchcore/proton/test/test.h>
-#include <vespa/searchcore/proton/test/transport_helper.h>
#include <vespa/searchcore/proton/test/thread_utils.h>
#include <vespa/vespalib/util/idestructorcallback.h>
#include <vespa/searchlib/index/docbuilder.h>
@@ -262,7 +261,7 @@ struct MyConfigSnapshot
DocBuilder _builder;
DocumentDBConfig::SP _cfg;
BootstrapConfig::SP _bootstrap;
- MyConfigSnapshot(FNET_Transport & transport, const Schema &schema, const vespalib::string &cfgDir)
+ MyConfigSnapshot(const Schema &schema, const vespalib::string &cfgDir)
: _schema(schema),
_builder(_schema),
_cfg(),
@@ -280,7 +279,7 @@ struct MyConfigSnapshot
::config::DirSpec spec(cfgDir);
DocumentDBConfigHelper mgr(spec, "searchdocument");
mgr.forwardConfig(_bootstrap);
- mgr.nextGeneration(transport, 1ms);
+ mgr.nextGeneration(1ms);
_cfg = mgr.getConfig();
}
};
@@ -288,28 +287,26 @@ struct MyConfigSnapshot
template <typename Traits>
struct FixtureBase
{
- TransportMgr _transport;
- ThreadStackExecutor _summaryExecutor;
+ ThreadStackExecutor _summaryExecutor;
ExecutorThreadingService _writeService;
- typename Traits::Config _cfg;
+ typename Traits::Config _cfg;
std::shared_ptr<bucketdb::BucketDBOwner> _bucketDB;
- BucketDBHandler _bucketDBHandler;
+ BucketDBHandler _bucketDBHandler;
typename Traits::Context _ctx;
- typename Traits::Schema _baseSchema;
- MyConfigSnapshot::UP _snapshot;
- DirectoryHandler _baseDir;
- typename Traits::SubDB _subDb;
- IFeedView::SP _tmpFeedView;
+ typename Traits::Schema _baseSchema;
+ MyConfigSnapshot::UP _snapshot;
+ DirectoryHandler _baseDir;
+ typename Traits::SubDB _subDb;
+ IFeedView::SP _tmpFeedView;
FixtureBase()
- : _transport(),
- _summaryExecutor(1, 64_Ki),
+ : _summaryExecutor(1, 64_Ki),
_writeService(_summaryExecutor),
_cfg(),
_bucketDB(std::make_shared<bucketdb::BucketDBOwner>()),
_bucketDBHandler(*_bucketDB),
_ctx(_writeService, _bucketDB, _bucketDBHandler),
_baseSchema(),
- _snapshot(std::make_unique<MyConfigSnapshot>(_transport.transport(), _baseSchema, Traits::ConfigDir::dir())),
+ _snapshot(std::make_unique<MyConfigSnapshot>(_baseSchema, Traits::ConfigDir::dir())),
_baseDir(BASE_DIR + "/" + SUB_NAME, BASE_DIR),
_subDb(_cfg._cfg, _ctx._ctx),
_tmpFeedView()
@@ -349,7 +346,7 @@ struct FixtureBase
runInMasterAndSync([&]() { performReconfig(serialNum, reconfigSchema, reconfigConfigDir); });
}
void performReconfig(SerialNum serialNum, const Schema &reconfigSchema, const vespalib::string &reconfigConfigDir) {
- auto newCfg = std::make_unique<MyConfigSnapshot>(_transport.transport(), reconfigSchema, reconfigConfigDir);
+ auto newCfg = std::make_unique<MyConfigSnapshot>(reconfigSchema, reconfigConfigDir);
DocumentDBConfig::ComparisonResult cmpResult;
cmpResult.attributesChanged = true;
cmpResult.documenttypesChanged = true;
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index bef8d0c49bb..7ba3e0b8240 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -149,7 +149,7 @@ Fixture::Fixture(bool file_config)
_bucketExecutor(2),
_db(),
_fileHeaderContext(),
- _tls(_shared_service.transport(), "tmp", 9014, ".", _fileHeaderContext),
+ _tls("tmp", 9014, ".", _fileHeaderContext),
_queryLimiter(),
_clock()
{
@@ -165,7 +165,7 @@ Fixture::Fixture(bool file_config)
std::make_shared<BucketspacesConfig>(),
tuneFileDocumentDB, HwInfo());
mgr.forwardConfig(b);
- mgr.nextGeneration(_shared_service.transport(), 0ms);
+ mgr.nextGeneration(0ms);
_db = DocumentDB::create(".", mgr.getConfig(), "tcp/localhost:9014", _queryLimiter, _clock, DocTypeName("typea"),
makeBucketSpace(),
*b->getProtonConfigSP(), _myDBOwner, _shared_service, _bucketExecutor, _tls, _dummy,
@@ -183,7 +183,7 @@ std::unique_ptr<ConfigStore>
Fixture::make_config_store()
{
if (_file_config) {
- return std::make_unique<FileConfigManager>(_shared_service.transport(), "config", "", "typea");
+ return std::make_unique<FileConfigManager>("config", "", "typea");
} else {
return std::make_unique<MemoryConfigStore>();
}
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index 9a8d8bad60e..904937a26da 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -27,14 +27,12 @@
#include <vespa/searchcore/proton/server/i_feed_handler_owner.h>
#include <vespa/searchcore/proton/server/ireplayconfig.h>
#include <vespa/searchcore/proton/test/dummy_feed_view.h>
-#include <vespa/searchcore/proton/test/transport_helper.h>
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/util/exceptions.h>
-#include <vespa/vespalib/util/size_literals.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/log/log.h>
@@ -409,7 +407,6 @@ struct MyTlsWriter : TlsWriter {
struct FeedHandlerFixture
{
DummyFileHeaderContext _fileHeaderContext;
- TransportMgr _transport;
TransLogServer tls;
vespalib::string tlsSpec;
vespalib::ThreadStackExecutor sharedExecutor;
@@ -426,8 +423,7 @@ struct FeedHandlerFixture
FeedHandler handler;
FeedHandlerFixture()
: _fileHeaderContext(),
- _transport(),
- tls(_transport.transport(), "mytls", 9016, "mytlsdir", _fileHeaderContext, DomainConfig().setPartSizeLimit(0x10000)),
+ tls("mytls", 9016, "mytlsdir", _fileHeaderContext, DomainConfig().setPartSizeLimit(0x10000)),
tlsSpec("tcp/localhost:9016"),
sharedExecutor(1, 0x10000),
writeService(sharedExecutor),
diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
index d51ea25f2f5..68b9d2f8d6e 100644
--- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
@@ -13,13 +13,11 @@
#include <vespa/searchcore/proton/server/bootstrapconfig.h>
#include <vespa/searchcore/proton/server/fileconfigmanager.h>
#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
-#include <vespa/searchcore/proton/test/transport_helper.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/config-bucketspaces.h>
#include <vespa/vespalib/testkit/test_kit.h>
-
using namespace cloud::config::filedistribution;
using namespace config;
using namespace document;
@@ -41,7 +39,7 @@ using vespalib::nbostream;
vespalib::string myId("myconfigid");
DocumentDBConfig::SP
-makeBaseConfigSnapshot(FNET_Transport & transport)
+makeBaseConfigSnapshot()
{
::config::DirSpec spec(TEST_PATH("cfg"));
@@ -54,7 +52,7 @@ makeBaseConfigSnapshot(FNET_Transport & transport)
std::make_shared<BucketspacesConfig>(),
std::make_shared<TuneFileDocumentDB>(), HwInfo());
dbcm.forwardConfig(b);
- dbcm.nextGeneration(transport, 0ms);
+ dbcm.nextGeneration(0ms);
DocumentDBConfig::SP snap = dbcm.getConfig();
snap->setConfigId(myId);
ASSERT_TRUE(snap);
@@ -62,9 +60,9 @@ makeBaseConfigSnapshot(FNET_Transport & transport)
}
void
-saveBaseConfigSnapshot(FNET_Transport & transport, const DocumentDBConfig &snap, SerialNum num)
+saveBaseConfigSnapshot(const DocumentDBConfig &snap, SerialNum num)
{
- FileConfigManager cm(transport, "out", myId, snap.getDocTypeName());
+ FileConfigManager cm("out", myId, snap.getDocTypeName());
cm.saveConfig(snap, num);
}
@@ -127,55 +125,55 @@ addConfigsThatAreNotSavedToDisk(const DocumentDBConfig &cfg)
return builder.build();
}
-TEST_FF("requireThatConfigCanBeSavedAndLoaded", TransportMgr(), DocumentDBConfig::SP(makeBaseConfigSnapshot(f1.transport())))
+TEST_F("requireThatConfigCanBeSavedAndLoaded", DocumentDBConfig::SP(makeBaseConfigSnapshot()))
{
- DocumentDBConfig::SP fullCfg = addConfigsThatAreNotSavedToDisk(*f2);
- saveBaseConfigSnapshot(f1.transport(), *fullCfg, 20);
+ DocumentDBConfig::SP fullCfg = addConfigsThatAreNotSavedToDisk(*f);
+ saveBaseConfigSnapshot(*fullCfg, 20);
DocumentDBConfig::SP esnap(makeEmptyConfigSnapshot());
{
- FileConfigManager cm(f1.transport(), "out", myId, "dummy");
+ FileConfigManager cm("out", myId, "dummy");
cm.loadConfig(*esnap, 20, esnap);
}
- assertEqualSnapshot(*f2, *esnap);
+ assertEqualSnapshot(*f, *esnap);
}
-TEST_FF("requireThatConfigCanBeSerializedAndDeserialized", TransportMgr(), DocumentDBConfig::SP(makeBaseConfigSnapshot(f1.transport())))
+TEST_F("requireThatConfigCanBeSerializedAndDeserialized", DocumentDBConfig::SP(makeBaseConfigSnapshot()))
{
- saveBaseConfigSnapshot(f1.transport(), *f2, 30);
+ saveBaseConfigSnapshot(*f, 30);
nbostream stream;
{
- FileConfigManager cm(f1.transport(), "out", myId, "dummy");
+ FileConfigManager cm("out", myId, "dummy");
cm.serializeConfig(30, stream);
}
{
- FileConfigManager cm(f1.transport(), "out", myId, "dummy");
+ FileConfigManager cm("out", myId, "dummy");
cm.deserializeConfig(40, stream);
}
DocumentDBConfig::SP fsnap(makeEmptyConfigSnapshot());
{
- FileConfigManager cm(f1.transport(), "out", myId, "dummy");
+ FileConfigManager cm("out", myId, "dummy");
cm.loadConfig(*fsnap, 40, fsnap);
}
- assertEqualSnapshot(*f2, *fsnap);
+ assertEqualSnapshot(*f, *fsnap);
EXPECT_EQUAL("dummy", fsnap->getDocTypeName());
}
-TEST_FF("requireThatConfigCanBeLoadedWithoutExtraConfigsDataFile", TransportMgr(), DocumentDBConfig::SP(makeBaseConfigSnapshot(f1.transport())))
+TEST_F("requireThatConfigCanBeLoadedWithoutExtraConfigsDataFile", DocumentDBConfig::SP(makeBaseConfigSnapshot()))
{
- saveBaseConfigSnapshot(f1.transport(), *f2, 70);
+ saveBaseConfigSnapshot(*f, 70);
EXPECT_FALSE(vespalib::unlink("out/config-70/extraconfigs.dat"));
DocumentDBConfig::SP esnap(makeEmptyConfigSnapshot());
{
- FileConfigManager cm(f1.transport(), "out", myId, "dummy");
+ FileConfigManager cm("out", myId, "dummy");
cm.loadConfig(*esnap, 70, esnap);
}
}
-TEST_FF("requireThatVisibilityDelayIsPropagated", TransportMgr(), DocumentDBConfig::SP(makeBaseConfigSnapshot(f1.transport())))
+TEST_F("requireThatVisibilityDelayIsPropagated", DocumentDBConfig::SP(makeBaseConfigSnapshot()))
{
- saveBaseConfigSnapshot(f1.transport(), *f2, 80);
+ saveBaseConfigSnapshot(*f, 80);
DocumentDBConfig::SP esnap(makeEmptyConfigSnapshot());
{
ProtonConfigBuilder protonConfigBuilder;
@@ -184,7 +182,7 @@ TEST_FF("requireThatVisibilityDelayIsPropagated", TransportMgr(), DocumentDBConf
ddb.visibilitydelay = 61.0;
protonConfigBuilder.documentdb.push_back(ddb);
protonConfigBuilder.maxvisibilitydelay = 100.0;
- FileConfigManager cm(f1.transport(), "out", myId, "dummy");
+ FileConfigManager cm("out", myId, "dummy");
cm.setProtonConfig(std::make_shared<ProtonConfig>(protonConfigBuilder));
cm.loadConfig(*esnap, 70, esnap);
}
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index 39a5c69376c..9657619be40 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -33,7 +33,6 @@
#include <vespa/searchcore/proton/test/disk_mem_usage_notifier.h>
#include <vespa/searchcore/proton/test/mock_attribute_manager.h>
#include <vespa/searchcore/proton/test/test.h>
-#include <vespa/searchcore/proton/test/transport_helper.h>
#include <vespa/searchlib/common/idocumentmetastore.h>
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/vespalib/data/slime/slime.h>
@@ -349,7 +348,6 @@ public:
test::DiskMemUsageNotifier _diskMemUsageNotifier;
BucketCreateNotifier _bucketCreateNotifier;
MonitoredRefCount _refCount;
- TransportMgr _transport;
MaintenanceController _mc;
MaintenanceControllerFixture();
@@ -769,8 +767,7 @@ MaintenanceControllerFixture::MaintenanceControllerFixture()
_attributeUsageFilter(),
_bucketCreateNotifier(),
_refCount(),
- _transport(),
- _mc(_transport.transport(), _threadService, _genericExecutor, _refCount, _docTypeName)
+ _mc(_threadService, _genericExecutor, _refCount, _docTypeName)
{
std::vector<MyDocumentSubDB *> subDBs;
subDBs.push_back(&_ready);