test_util.cpp 14.8 KB
Newer Older
J
jinhai 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

18
#include "utils/SignalUtil.h"
G
groot 已提交
19 20
#include "utils/CommonUtil.h"
#include "utils/Error.h"
G
groot 已提交
21
#include "utils/StringHelpFunctions.h"
G
groot 已提交
22 23
#include "utils/TimeRecorder.h"
#include "utils/BlockingQueue.h"
G
groot 已提交
24
#include "utils/LogUtil.h"
S
starlord 已提交
25 26
#include "utils/ValidationUtil.h"
#include "db/engine/ExecutionEngine.h"
G
groot 已提交
27

28 29 30 31 32 33
#include <thread>
#include <sys/types.h>
#include <sys/stat.h>
#include <boost/filesystem.hpp>
#include <gtest/gtest.h>

G
groot 已提交
34
namespace {
G
groot 已提交
35

S
starlord 已提交
36
static const char* LOG_FILE_PATH = "./milvus/conf/log_config.conf";
G
groot 已提交
37

S
starlord 已提交
38
void
S
starlord 已提交
39
CopyStatus(milvus::Status& st1, milvus::Status& st2) {
S
starlord 已提交
40 41 42
    st1 = st2;
}

S
starlord 已提交
43
} // namespace
G
groot 已提交
44

G
groot 已提交
45 46
TEST(UtilTest, EXCEPTION_TEST) {
    std::string err_msg = "failed";
S
starlord 已提交
47 48
    milvus::server::ServerException ex(milvus::SERVER_UNEXPECTED_ERROR, err_msg);
    ASSERT_EQ(ex.error_code(), milvus::SERVER_UNEXPECTED_ERROR);
G
groot 已提交
49 50 51 52
    std::string msg = ex.what();
    ASSERT_EQ(msg, err_msg);
}

S
starlord 已提交
53
TEST(UtilTest, SIGNAL_TEST) {
S
starlord 已提交
54
    milvus::server::SignalUtil::PrintStacktrace();
S
starlord 已提交
55 56
}

G
groot 已提交
57
TEST(UtilTest, COMMON_TEST) {
S
starlord 已提交
58
    uint64_t total_mem = 0, free_mem = 0;
S
starlord 已提交
59
    milvus::server::CommonUtil::GetSystemMemInfo(total_mem, free_mem);
G
groot 已提交
60 61 62
    ASSERT_GT(total_mem, 0);
    ASSERT_GT(free_mem, 0);

S
starlord 已提交
63
    uint32_t thread_cnt = 0;
S
starlord 已提交
64
    milvus::server::CommonUtil::GetSystemAvailableThreads(thread_cnt);
G
groot 已提交
65 66
    ASSERT_GT(thread_cnt, 0);

G
groot 已提交
67 68 69
    std::string path1 = "/tmp/milvus_test/";
    std::string path2 = path1 + "common_test_12345/";
    std::string path3 = path2 + "abcdef";
S
starlord 已提交
70
    milvus::Status status = milvus::server::CommonUtil::CreateDirectory(path3);
S
starlord 已提交
71
    ASSERT_TRUE(status.ok());
G
groot 已提交
72
    //test again
S
starlord 已提交
73
    status = milvus::server::CommonUtil::CreateDirectory(path3);
S
starlord 已提交
74
    ASSERT_TRUE(status.ok());
G
groot 已提交
75

S
starlord 已提交
76
    ASSERT_TRUE(milvus::server::CommonUtil::IsDirectoryExist(path3));
G
groot 已提交
77

S
starlord 已提交
78
    status = milvus::server::CommonUtil::DeleteDirectory(path1);
S
starlord 已提交
79
    ASSERT_TRUE(status.ok());
G
groot 已提交
80
    //test again
S
starlord 已提交
81
    status = milvus::server::CommonUtil::DeleteDirectory(path1);
S
starlord 已提交
82
    ASSERT_TRUE(status.ok());
G
groot 已提交
83

S
starlord 已提交
84 85
    ASSERT_FALSE(milvus::server::CommonUtil::IsDirectoryExist(path1));
    ASSERT_FALSE(milvus::server::CommonUtil::IsFileExist(path1));
G
groot 已提交
86

S
starlord 已提交
87
    std::string exe_path = milvus::server::CommonUtil::GetExePath();
G
groot 已提交
88 89 90
    ASSERT_FALSE(exe_path.empty());

    time_t tt;
S
starlord 已提交
91
    time(&tt);
G
groot 已提交
92 93
    tm time_struct;
    memset(&time_struct, 0, sizeof(tm));
S
starlord 已提交
94
    milvus::server::CommonUtil::ConvertTime(tt, time_struct);
G
groot 已提交
95 96 97
    ASSERT_GT(time_struct.tm_year, 0);
    ASSERT_GT(time_struct.tm_mon, 0);
    ASSERT_GT(time_struct.tm_mday, 0);
S
starlord 已提交
98
    milvus::server::CommonUtil::ConvertTime(time_struct, tt);
G
groot 已提交
99 100
    ASSERT_GT(tt, 0);

S
starlord 已提交
101
    bool res = milvus::server::CommonUtil::TimeStrToTime("2019-03-23", tt, time_struct);
G
groot 已提交
102 103 104 105 106
    ASSERT_EQ(time_struct.tm_year, 119);
    ASSERT_EQ(time_struct.tm_mon, 2);
    ASSERT_EQ(time_struct.tm_mday, 23);
    ASSERT_GT(tt, 0);
    ASSERT_TRUE(res);
G
groot 已提交
107 108 109
}

TEST(UtilTest, STRINGFUNCTIONS_TEST) {
S
starlord 已提交
110
    std::string str = " test str";
S
starlord 已提交
111
    milvus::server::StringHelpFunctions::TrimStringBlank(str);
S
starlord 已提交
112
    ASSERT_EQ(str, "test str");
G
groot 已提交
113

S
starlord 已提交
114
    str = "\"test str\"";
S
starlord 已提交
115
    milvus::server::StringHelpFunctions::TrimStringQuote(str, "\"");
S
starlord 已提交
116
    ASSERT_EQ(str, "test str");
G
groot 已提交
117

G
groot 已提交
118 119
    str = "a,b,c";
    std::vector<std::string> result;
S
starlord 已提交
120
    auto status = milvus::server::StringHelpFunctions::SplitStringByDelimeter(str, ",", result);
S
starlord 已提交
121
    ASSERT_TRUE(status.ok());
G
groot 已提交
122 123 124
    ASSERT_EQ(result.size(), 3UL);

    result.clear();
S
starlord 已提交
125
    status = milvus::server::StringHelpFunctions::SplitStringByQuote(str, ",", "\"", result);
S
starlord 已提交
126
    ASSERT_TRUE(status.ok());
G
groot 已提交
127 128 129
    ASSERT_EQ(result.size(), 3UL);

    result.clear();
S
starlord 已提交
130
    status = milvus::server::StringHelpFunctions::SplitStringByQuote(str, ",", "", result);
S
starlord 已提交
131
    ASSERT_TRUE(status.ok());
G
groot 已提交
132 133 134 135
    ASSERT_EQ(result.size(), 3UL);

    str = "55,\"aa,gg,yy\",b";
    result.clear();
S
starlord 已提交
136
    status = milvus::server::StringHelpFunctions::SplitStringByQuote(str, ",", "\"", result);
S
starlord 已提交
137
    ASSERT_TRUE(status.ok());
G
groot 已提交
138 139 140 141
    ASSERT_EQ(result.size(), 3UL);
}

TEST(UtilTest, BLOCKINGQUEUE_TEST) {
S
starlord 已提交
142
    milvus::server::BlockingQueue<std::string> bq;
G
groot 已提交
143 144 145 146

    static const size_t count = 10;
    bq.SetCapacity(count);

S
starlord 已提交
147
    for (size_t i = 1; i <= count; i++) {
G
groot 已提交
148 149
        std::string id = "No." + std::to_string(i);
        bq.Put(id);
G
groot 已提交
150 151
    }

G
groot 已提交
152 153 154 155 156 157 158 159 160
    ASSERT_EQ(bq.Size(), count);
    ASSERT_FALSE(bq.Empty());

    std::string str = bq.Front();
    ASSERT_EQ(str, "No.1");

    str = bq.Back();
    ASSERT_EQ(str, "No." + std::to_string(count));

S
starlord 已提交
161
    for (size_t i = 1; i <= count; i++) {
G
groot 已提交
162 163 164 165
        std::string id = "No." + std::to_string(i);
        str = bq.Take();
        ASSERT_EQ(id, str);
    }
G
groot 已提交
166 167

    ASSERT_EQ(bq.Size(), 0);
G
groot 已提交
168 169
}

G
groot 已提交
170
TEST(UtilTest, LOG_TEST) {
S
starlord 已提交
171
    auto status = milvus::server::InitLog(LOG_FILE_PATH);
S
starlord 已提交
172
    ASSERT_TRUE(status.ok());
G
groot 已提交
173

S
starlord 已提交
174 175 176
    EXPECT_FALSE(el::Loggers::hasFlag(el::LoggingFlag::NewLineForContainer));
    EXPECT_FALSE(el::Loggers::hasFlag(el::LoggingFlag::LogDetailedCrashReason));

S
starlord 已提交
177
    std::string fname = milvus::server::CommonUtil::GetFileName(LOG_FILE_PATH);
G
groot 已提交
178 179
    ASSERT_EQ(fname, "log_config.conf");
}
S
starlord 已提交
180

S
starlord 已提交
181
TEST(UtilTest, TIMERECORDER_TEST) {
S
starlord 已提交
182 183
    for (int64_t log_level = 0; log_level <= 6; log_level++) {
        if (log_level == 5) {
S
starlord 已提交
184 185
            continue; //skip fatal
        }
S
starlord 已提交
186
        milvus::TimeRecorder rc("time", log_level);
S
starlord 已提交
187 188 189 190
        rc.RecordSection("end");
    }
}

S
starlord 已提交
191
TEST(UtilTest, STATUS_TEST) {
S
starlord 已提交
192
    auto status = milvus::Status::OK();
S
starlord 已提交
193 194 195
    std::string str = status.ToString();
    ASSERT_FALSE(str.empty());

S
starlord 已提交
196 197
    status = milvus::Status(milvus::DB_ERROR, "mistake");
    ASSERT_EQ(status.code(), milvus::DB_ERROR);
S
starlord 已提交
198 199 200
    str = status.ToString();
    ASSERT_FALSE(str.empty());

S
starlord 已提交
201 202
    status = milvus::Status(milvus::DB_NOT_FOUND, "mistake");
    ASSERT_EQ(status.code(), milvus::DB_NOT_FOUND);
S
starlord 已提交
203 204 205
    str = status.ToString();
    ASSERT_FALSE(str.empty());

S
starlord 已提交
206 207
    status = milvus::Status(milvus::DB_ALREADY_EXIST, "mistake");
    ASSERT_EQ(status.code(), milvus::DB_ALREADY_EXIST);
S
starlord 已提交
208 209 210
    str = status.ToString();
    ASSERT_FALSE(str.empty());

S
starlord 已提交
211 212
    status = milvus::Status(milvus::DB_META_TRANSACTION_FAILED, "mistake");
    ASSERT_EQ(status.code(), milvus::DB_META_TRANSACTION_FAILED);
S
starlord 已提交
213 214 215
    str = status.ToString();
    ASSERT_FALSE(str.empty());

S
starlord 已提交
216
    auto status_copy = milvus::Status::OK();
S
starlord 已提交
217
    CopyStatus(status_copy, status);
S
starlord 已提交
218
    ASSERT_EQ(status.code(), milvus::DB_META_TRANSACTION_FAILED);
S
starlord 已提交
219 220 221 222 223 224 225 226 227 228

    auto status_ref(status);
    ASSERT_EQ(status_ref.code(), status.code());
    ASSERT_EQ(status_ref.ToString(), status.ToString());

    auto status_move = std::move(status);
    ASSERT_EQ(status_move.code(), status_ref.code());
    ASSERT_EQ(status_move.ToString(), status_ref.ToString());
}

S
starlord 已提交
229
TEST(ValidationUtilTest, VALIDATE_TABLENAME_TEST) {
S
starlord 已提交
230
    std::string table_name = "Normal123_";
S
starlord 已提交
231
    auto status = milvus::server::ValidationUtil::ValidateTableName(table_name);
S
starlord 已提交
232
    ASSERT_TRUE(status.ok());
S
starlord 已提交
233 234

    table_name = "12sds";
S
starlord 已提交
235 236
    status = milvus::server::ValidationUtil::ValidateTableName(table_name);
    ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
S
starlord 已提交
237 238

    table_name = "";
S
starlord 已提交
239 240
    status = milvus::server::ValidationUtil::ValidateTableName(table_name);
    ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
S
starlord 已提交
241 242

    table_name = "_asdasd";
S
starlord 已提交
243 244
    status = milvus::server::ValidationUtil::ValidateTableName(table_name);
    ASSERT_EQ(status.code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
245 246

    table_name = "!@#!@";
S
starlord 已提交
247 248
    status = milvus::server::ValidationUtil::ValidateTableName(table_name);
    ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
S
starlord 已提交
249

S
starlord 已提交
250
    table_name = "_!@#!@";
S
starlord 已提交
251 252
    status = milvus::server::ValidationUtil::ValidateTableName(table_name);
    ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
S
starlord 已提交
253

S
starlord 已提交
254
    table_name = "中文";
S
starlord 已提交
255 256
    status = milvus::server::ValidationUtil::ValidateTableName(table_name);
    ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
S
starlord 已提交
257

S
starlord 已提交
258
    table_name = std::string(10000, 'a');
S
starlord 已提交
259 260
    status = milvus::server::ValidationUtil::ValidateTableName(table_name);
    ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
S
starlord 已提交
261 262
}

S
starlord 已提交
263
TEST(ValidationUtilTest, VALIDATE_DIMENSION_TEST) {
S
starlord 已提交
264 265 266 267 268 269 270 271
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableDimension(-1).code(),
              milvus::SERVER_INVALID_VECTOR_DIMENSION);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableDimension(0).code(),
              milvus::SERVER_INVALID_VECTOR_DIMENSION);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableDimension(16385).code(),
              milvus::SERVER_INVALID_VECTOR_DIMENSION);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableDimension(16384).code(), milvus::SERVER_SUCCESS);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableDimension(1).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
272 273
}

S
starlord 已提交
274
TEST(ValidationUtilTest, VALIDATE_INDEX_TEST) {
S
starlord 已提交
275 276 277
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexType((int)milvus::engine::EngineType::INVALID).code(),
              milvus::SERVER_INVALID_INDEX_TYPE);
    for (int i = 1; i <= (int)milvus::engine::EngineType::MAX_VALUE; i++) {
S
starlord 已提交
278 279 280 281 282
#ifndef CUSTOMIZATION
        if (i == (int)milvus::engine::EngineType::FAISS_IVFSQ8H) {
            continue;
        }
#endif
S
starlord 已提交
283
        ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexType(i).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
284
    }
S
starlord 已提交
285 286 287
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexType(
        (int)milvus::engine::EngineType::MAX_VALUE + 1).code(),
              milvus::SERVER_INVALID_INDEX_TYPE);
S
starlord 已提交
288

S
starlord 已提交
289 290
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexNlist(0).code(), milvus::SERVER_INVALID_INDEX_NLIST);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexNlist(100).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
291

S
starlord 已提交
292 293 294
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexFileSize(0).code(),
              milvus::SERVER_INVALID_INDEX_FILE_SIZE);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexFileSize(100).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
295

S
starlord 已提交
296 297 298 299
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexMetricType(0).code(),
              milvus::SERVER_INVALID_INDEX_METRIC_TYPE);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexMetricType(1).code(), milvus::SERVER_SUCCESS);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateTableIndexMetricType(2).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
300 301
}

S
starlord 已提交
302
TEST(ValidationUtilTest, VALIDATE_TOPK_TEST) {
S
starlord 已提交
303 304 305 306
    milvus::engine::meta::TableSchema schema;
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateSearchTopk(10, schema).code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateSearchTopk(65536, schema).code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateSearchTopk(0, schema).code(), milvus::SERVER_SUCCESS);
307 308
}

S
starlord 已提交
309
TEST(ValidationUtilTest, VALIDATE_NPROBE_TEST) {
S
starlord 已提交
310
    milvus::engine::meta::TableSchema schema;
311
    schema.nlist_ = 100;
S
starlord 已提交
312 313 314
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateSearchNprobe(10, schema).code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateSearchNprobe(0, schema).code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateSearchNprobe(101, schema).code(), milvus::SERVER_SUCCESS);
315 316
}

S
starlord 已提交
317
TEST(ValidationUtilTest, VALIDATE_GPU_TEST) {
S
starlord 已提交
318 319
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateGpuIndex(0).code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateGpuIndex(100).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
320 321

    size_t memory = 0;
S
starlord 已提交
322 323
    ASSERT_EQ(milvus::server::ValidationUtil::GetGpuMemory(0, memory).code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::GetGpuMemory(100, memory).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
324 325
}

S
starlord 已提交
326
TEST(ValidationUtilTest, VALIDATE_IPADDRESS_TEST) {
S
starlord 已提交
327 328
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateIpAddress("127.0.0.1").code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateIpAddress("not ip").code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
329 330 331
}

TEST(ValidationUtilTest, VALIDATE_NUMBER_TEST) {
S
starlord 已提交
332 333
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateStringIsNumber("1234").code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateStringIsNumber("not number").code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
334 335 336 337
}

TEST(ValidationUtilTest, VALIDATE_BOOL_TEST) {
    std::string str = "true";
S
starlord 已提交
338
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateStringIsBool(str).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
339
    str = "not bool";
S
starlord 已提交
340
    ASSERT_NE(milvus::server::ValidationUtil::ValidateStringIsBool(str).code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
341 342 343
}

TEST(ValidationUtilTest, VALIDATE_DOUBLE_TEST) {
S
starlord 已提交
344 345
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateStringIsFloat("2.5").code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateStringIsFloat("not double").code(), milvus::SERVER_SUCCESS);
S
starlord 已提交
346 347 348
}

TEST(ValidationUtilTest, VALIDATE_DBURI_TEST) {
S
starlord 已提交
349 350 351 352 353 354 355
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateDbURI("sqlite://:@:/").code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateDbURI("xxx://:@:/").code(), milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateDbURI("not uri").code(), milvus::SERVER_SUCCESS);
    ASSERT_EQ(milvus::server::ValidationUtil::ValidateDbURI("mysql://root:123456@127.0.0.1:3303/milvus").code(),
              milvus::SERVER_SUCCESS);
    ASSERT_NE(milvus::server::ValidationUtil::ValidateDbURI("mysql://root:123456@127.0.0.1:port/milvus").code(),
              milvus::SERVER_SUCCESS);
S
starlord 已提交
356
}
H
Heisenberg 已提交
357

S
starlord 已提交
358
TEST(UtilTest, ROLLOUTHANDLER_TEST) {
H
Heisenberg 已提交
359 360
    std::string dir1 = "/tmp/milvus_test";
    std::string dir2 = "/tmp/milvus_test/log_test";
S
starlord 已提交
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
    std::string filename[6] = {
        "log_global.log",
        "log_debug.log",
        "log_warning.log",
        "log_trace.log",
        "log_error.log",
        "log_fatal.log"};

    el::Level list[6] = {
        el::Level::Global,
        el::Level::Debug,
        el::Level::Warning,
        el::Level::Trace,
        el::Level::Error,
        el::Level::Fatal};
H
Heisenberg 已提交
376 377 378 379 380 381 382 383

    mkdir(dir1.c_str(), S_IRWXU);
    mkdir(dir2.c_str(), S_IRWXU);
    for (int i = 0; i < 6; ++i) {
        std::string tmp = dir2 + "/" + filename[i];

        std::ofstream file;
        file.open(tmp.c_str());
S
starlord 已提交
384
        file << "test" << std::endl;
H
Heisenberg 已提交
385

S
starlord 已提交
386
        milvus::server::RolloutHandler(tmp.c_str(), 0, list[i]);
H
Heisenberg 已提交
387 388 389 390 391 392 393

        tmp.append(".1");
        std::ifstream file2;
        file2.open(tmp);

        std::string tmp2;
        file2 >> tmp2;
S
starlord 已提交
394
        ASSERT_EQ(tmp2, "test");
H
Heisenberg 已提交
395 396
    }
    boost::filesystem::remove_all(dir2);
S
starlord 已提交
397
}