aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/index
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-11-10 14:19:55 +0100
committerTor Egge <Tor.Egge@online.no>2021-11-10 14:53:14 +0100
commit634dc8044870d056eb4dfaae7b4f6b7e7f81649c (patch)
tree268462246a620418cf5e635480afb5c32448558f /searchcore/src/tests/proton/index
parent8dcbd10ee9d81cd546b8cfffef42e0f4198ed172 (diff)
Keep write context live until inverter thread has completed invert task.
Diffstat (limited to 'searchcore/src/tests/proton/index')
-rw-r--r--searchcore/src/tests/proton/index/fusionrunner_test.cpp2
-rw-r--r--searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp4
-rw-r--r--searchcore/src/tests/proton/index/indexmanager_test.cpp10
3 files changed, 8 insertions, 8 deletions
diff --git a/searchcore/src/tests/proton/index/fusionrunner_test.cpp b/searchcore/src/tests/proton/index/fusionrunner_test.cpp
index 736bc4bae96..ae85211fe24 100644
--- a/searchcore/src/tests/proton/index/fusionrunner_test.cpp
+++ b/searchcore/src/tests/proton/index/fusionrunner_test.cpp
@@ -157,7 +157,7 @@ Document::UP buildDocument(DocBuilder & doc_builder, int id, const string &word)
void addDocument(DocBuilder & doc_builder, MemoryIndex &index, ISourceSelector &selector,
uint8_t index_id, uint32_t docid, const string &word) {
Document::UP doc = buildDocument(doc_builder, docid, word);
- index.insertDocument(docid, *doc);
+ index.insertDocument(docid, *doc, {});
vespalib::Gate gate;
index.commit(std::make_shared<vespalib::GateCallback>(gate));
selector.setSource(docid, index_id);
diff --git a/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp b/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp
index ac17c17892c..62a691d72e6 100644
--- a/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp
+++ b/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp
@@ -49,7 +49,7 @@ struct MyIndexManager : public test::MockIndexManager
return toString(removes[lid]);
}
// Implements IIndexManager
- void putDocument(uint32_t lid, const Document &, SerialNum serialNum) override {
+ void putDocument(uint32_t lid, const Document &, SerialNum serialNum, OnWriteDoneType) override {
puts[lid].push_back(serialNum);
}
void removeDocuments(LidVector lids, SerialNum serialNum) override {
@@ -94,7 +94,7 @@ struct Fixture
return builder.endDocument();
}
void put(SerialNum serialNum, const search::DocumentIdT lid) {
- iw.put(serialNum, *dummyDoc, lid);
+ iw.put(serialNum, *dummyDoc, lid, {});
iw.commit(serialNum, std::shared_ptr<IDestructorCallback>());
}
void remove(SerialNum serialNum, const search::DocumentIdT lid) {
diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp
index 8e41323e461..4c442d38443 100644
--- a/searchcore/src/tests/proton/index/indexmanager_test.cpp
+++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp
@@ -192,7 +192,7 @@ IndexManagerTest::addDocument(uint32_t id)
Document::UP doc = buildDocument(_builder, id, "foo");
SerialNum serialNum = ++_serial_num;
vespalib::Gate gate;
- runAsIndex([&]() { _index_manager->putDocument(id, *doc, serialNum);
+ runAsIndex([&]() { _index_manager->putDocument(id, *doc, serialNum, {});
_index_manager->commit(serialNum,
std::make_shared<vespalib::GateCallback>(gate)); });
gate.await();
@@ -416,7 +416,7 @@ TEST_F(IndexManagerTest, require_that_flush_stats_are_calculated)
EXPECT_EQ(0u, _index_manager->getMaintainer().getFlushStats().cpu_time_required);
Document::UP doc = addDocument(docid);
- inverter.invertDocument(docid, *doc);
+ inverter.invertDocument(docid, *doc, {});
push_documents_and_wait(inverter);
index_size = fic.getMemoryUsage().allocatedBytes() - fixed_index_size;
@@ -431,9 +431,9 @@ TEST_F(IndexManagerTest, require_that_flush_stats_are_calculated)
_index_manager->getMaintainer().getFlushStats().cpu_time_required);
doc = addDocument(docid + 10);
- inverter.invertDocument(docid + 10, *doc);
- doc = addDocument(docid + 100);
- inverter.invertDocument(docid + 100, *doc);
+ inverter.invertDocument(docid + 10, *doc, {});
+ auto doc100 = addDocument(docid + 100);
+ inverter.invertDocument(docid + 100, *doc100, {});
push_documents_and_wait(inverter);
index_size = fic.getMemoryUsage().allocatedBytes() - fixed_index_size;
/// Must account for both docid 0 being reserved and the extra after.