diff --git a/test/main.cpp b/test/main.cpp index 0e0bce39..19c3dd69 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -4,10 +4,7 @@ class TypesenseTestEnvironment : public testing::Environment { public: virtual void SetUp() { - auto log_worker = g3::LogWorker::createLogWorker(); - auto sink_handle = log_worker->addSink(std2::make_unique(), - &ConsoleLoggingSink::ReceiveLogMessage); - g3::initializeLogging(log_worker.get()); + } virtual void TearDown() { diff --git a/test/store_test.cpp b/test/store_test.cpp index 618cd3fe..7e96e9ce 100644 --- a/test/store_test.cpp +++ b/test/store_test.cpp @@ -64,6 +64,8 @@ TEST(StoreTest, GetUpdatesSince) { Store replica_store(replica_store_path); rocksdb::DB* replica_db = replica_store._get_db_unsafe(); + updates_op = primary_store.get_updates_since(0, 10); + for(const std::string & update: *updates_op.get()) { // Do Base64 encoding and decoding as we would in the API layer const std::string update_encoded = StringUtils::base64_encode(update); @@ -72,14 +74,14 @@ TEST(StoreTest, GetUpdatesSince) { replica_db->Write(rocksdb::WriteOptions(), &write_batch); } + delete updates_op.get(); + std::string value; for(auto i=1; i<=3; i++) { replica_store.get(std::string("foo")+std::to_string(i), value); ASSERT_EQ(std::string("bar")+std::to_string(i), value); } - delete updates_op.get(); - // Ensure that updates are limited to max_updates argument updates_op = primary_store.get_updates_since(0, 10); ASSERT_EQ(3, updates_op.get()->size()); @@ -127,5 +129,5 @@ TEST(StoreTest, GetUpdateSinceInvalidIterator) { Option*> updates_op = primary_store.get_updates_since(2, 10); ASSERT_FALSE(updates_op.ok()); ASSERT_EQ("Invalid iterator. Master's latest sequence number is 4 but updates are requested from sequence number 2. " - "The master's WAL entries might have expired (they are kept only for 24 hours).", updates_op.error()); + "The master's WAL entries might have expired (they are kept only for 24 hours).", updates_op.error()); } \ No newline at end of file