diff options
Diffstat (limited to 'searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp')
-rw-r--r-- | searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
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 b9e3549053a..397250f3d1e 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 @@ -36,6 +36,8 @@ #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/util/destructor_callbacks.h> #include <vespa/config/subscription/sourcespec.h> +#include <vespa/fastos/thread.h> +#include <vespa/fnet/transport.h> using namespace cloud::config::filedistribution; using namespace document; @@ -261,7 +263,7 @@ struct MyConfigSnapshot DocBuilder _builder; DocumentDBConfig::SP _cfg; BootstrapConfig::SP _bootstrap; - MyConfigSnapshot(const Schema &schema, const vespalib::string &cfgDir) + MyConfigSnapshot(FNET_Transport & transport, const Schema &schema, const vespalib::string &cfgDir) : _schema(schema), _builder(_schema), _cfg(), @@ -279,7 +281,7 @@ struct MyConfigSnapshot ::config::DirSpec spec(cfgDir); DocumentDBConfigHelper mgr(spec, "searchdocument"); mgr.forwardConfig(_bootstrap); - mgr.nextGeneration(1ms); + mgr.nextGeneration(transport, 1ms); _cfg = mgr.getConfig(); } }; @@ -287,35 +289,41 @@ struct MyConfigSnapshot template <typename Traits> struct FixtureBase { - ThreadStackExecutor _summaryExecutor; + FastOS_ThreadPool _threadPool; + FNET_Transport _transport; + 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() - : _summaryExecutor(1, 64_Ki), + : _threadPool(64_Ki), + _transport(), + _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>(_baseSchema, Traits::ConfigDir::dir())), + _snapshot(std::make_unique<MyConfigSnapshot>(_transport, _baseSchema, Traits::ConfigDir::dir())), _baseDir(BASE_DIR + "/" + SUB_NAME, BASE_DIR), _subDb(_cfg._cfg, _ctx._ctx), _tmpFeedView() { + _transport.Start(&_threadPool); init(); } ~FixtureBase() { _writeService.master().execute(makeLambdaTask([this]() { _subDb.close(); })); _writeService.shutdown(); + _transport.ShutDown(true); } void setBucketStateCalculator(const std::shared_ptr<IBucketStateCalculator> & calc) { vespalib::Gate gate; @@ -346,7 +354,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>(reconfigSchema, reconfigConfigDir); + auto newCfg = std::make_unique<MyConfigSnapshot>(_transport, reconfigSchema, reconfigConfigDir); DocumentDBConfig::ComparisonResult cmpResult; cmpResult.attributesChanged = true; cmpResult.documenttypesChanged = true; |