diff options
Diffstat (limited to 'searchcore/src/tests')
3 files changed, 4 insertions, 50 deletions
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp index 0f9df1fc594..c11bea14863 100644 --- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp @@ -140,14 +140,12 @@ struct MyIndexWriter : public test::MockIndexWriter MyLidVector _removes; int _heartBeatCount; uint32_t _commitCount; - uint32_t _wantedLidLimit; MyTracer &_tracer; MyIndexWriter(MyTracer &tracer) : test::MockIndexWriter(IIndexManager::SP(new test::MockIndexManager())), _removes(), _heartBeatCount(0), _commitCount(0), - _wantedLidLimit(0), _tracer(tracer) {} virtual void put(SerialNum serialNum, const document::Document &doc, @@ -166,9 +164,6 @@ struct MyIndexWriter : public test::MockIndexWriter _tracer.traceCommit(indexAdapterTypeName, serialNum); } virtual void heartBeat(SerialNum) override { ++_heartBeatCount; } - void compactLidSpace(SerialNum, uint32_t lidLimit) override { - _wantedLidLimit = lidLimit; - } }; struct MyGidToLidChangeHandler : public MockGidToLidChangeHandler @@ -1149,7 +1144,7 @@ TEST_F("require that compactLidSpace() propagates to document meta store and doc f.compactLidSpaceAndWait(2); // performIndexForceCommit in index thread, then completion callback // in master thread. - EXPECT_TRUE(assertThreadObserver(7, 5, 3, f.writeServiceObserver())); + EXPECT_TRUE(assertThreadObserver(7, 4, 3, f.writeServiceObserver())); EXPECT_EQUAL(2u, f.metaStoreObserver()._compactLidSpaceLidLimit); EXPECT_EQUAL(2u, f.getDocumentStore()._compactLidSpaceLidLimit); EXPECT_EQUAL(1u, f.metaStoreObserver()._holdUnblockShrinkLidSpaceCnt); @@ -1167,7 +1162,7 @@ TEST_F("require that compactLidSpace() doesn't propagate to " op.setSerialNum(0); f.runInMaster([&] () { f.fv.handleCompactLidSpace(op); }); // Delayed holdUnblockShrinkLidSpace() in index thread, then master thread - EXPECT_TRUE(assertThreadObserver(6, 4, 3, f.writeServiceObserver())); + EXPECT_TRUE(assertThreadObserver(6, 3, 3, f.writeServiceObserver())); EXPECT_EQUAL(0u, f.metaStoreObserver()._compactLidSpaceLidLimit); EXPECT_EQUAL(0u, f.getDocumentStore()._compactLidSpaceLidLimit); EXPECT_EQUAL(0u, f.metaStoreObserver()._holdUnblockShrinkLidSpaceCnt); @@ -1181,13 +1176,6 @@ TEST_F("require that compactLidSpace() propagates to attributeadapter", EXPECT_EQUAL(2u, f.maw._wantedLidLimit); } -TEST_F("require that compactLidSpace() propagates to index writer", - SearchableFeedViewFixture) -{ - f.populateBeforeCompactLidSpace(); - f.compactLidSpaceAndWait(2); - EXPECT_EQUAL(2u, f.miw._wantedLidLimit); -} TEST_F("require that commit is called if visibility delay is 0", SearchableFeedViewFixture) 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 8f5d998b77a..0d9fe42b978 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 @@ -33,11 +33,8 @@ struct MyIndexManager : public test::MockIndexManager SerialNum current; SerialNum flushed; SerialNum commitSerial; - uint32_t wantedLidLimit; - SerialNum compactSerial; MyIndexManager() : puts(), removes(), current(0), flushed(0), - commitSerial(0), - wantedLidLimit(0), compactSerial(0) + commitSerial(0) { } std::string getPut(uint32_t lid) { @@ -65,10 +62,6 @@ struct MyIndexManager : public test::MockIndexManager virtual SerialNum getFlushedSerialNum() const override { return flushed; } - void compactLidSpace(uint32_t lidLimit, SerialNum serialNum) override { - wantedLidLimit = lidLimit; - compactSerial = serialNum; - } }; struct Fixture @@ -102,7 +95,7 @@ struct Fixture } }; -TEST_F("require that index writer ignores old operations", Fixture) +TEST_F("require that index adapter ignores old operations", Fixture) { f.mim.flushed = 10; f.put(8, 1); @@ -117,13 +110,6 @@ TEST_F("require that commit is forwarded to index manager", Fixture) EXPECT_EQUAL(10u, f.mim.commitSerial); } -TEST_F("require that compactLidSpace is forwarded to index manager", Fixture) -{ - f.iw.compactLidSpace(4, 2); - EXPECT_EQUAL(2u, f.mim.wantedLidLimit); - EXPECT_EQUAL(4u, f.mim.compactSerial); -} - TEST_MAIN() { TEST_RUN_ALL(); diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp index d9f0a256faf..c025bd257a2 100644 --- a/searchcore/src/tests/proton/index/indexmanager_test.cpp +++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp @@ -145,14 +145,6 @@ struct Fixture { }); _writeService.indexFieldWriter().sync(); } - void removeDocument(uint32_t docId) { - SerialNum serialNum = ++_serial_num; - removeDocument(docId, serialNum); - } - void compactLidSpace(uint32_t lidLimit) { - SerialNum serialNum = ++_serial_num; - runAsIndex([&]() { _index_manager->compactLidSpace(lidLimit, serialNum); }); - } void assertStats(uint32_t expNumDiskIndexes, uint32_t expNumMemoryIndexes, SerialNum expLastiskIndexSerialNum, @@ -723,18 +715,6 @@ TEST_F("require that indexes manager stats can be generated", Fixture) TEST_DO(f.assertStats(1, 1, 1, 2)); } -TEST_F("require that compactLidSpace works", Fixture) -{ - Schema empty_schema; - f.addDocument(1); - f.addDocument(2); - f.removeDocument(2); - auto fsc = f._index_manager->getMaintainer().getSourceCollection(); - EXPECT_EQUAL(3u, fsc->getSourceSelector().getDocIdLimit()); - f.compactLidSpace(2); - EXPECT_EQUAL(2u, fsc->getSourceSelector().getDocIdLimit()); -} - } // namespace TEST_MAIN() { |