提交 4bd3e1f2 编写于 作者: S starlord 提交者: jinhai

avoid unitest hang


Former-commit-id: 95e1d10cb61ff5f8c7e5b8b38564f2c7ab78865c
上级 72877cf3
...@@ -32,12 +32,19 @@ using namespace zilliz::milvus::engine; ...@@ -32,12 +32,19 @@ using namespace zilliz::milvus::engine;
//} //}
TEST_F(MySQLTest, core) { TEST_F(MySQLTest, core) {
// DBMetaOptions options; DBMetaOptions options;
// //dialect+driver://username:password@host:port/database // //dialect+driver://username:password@host:port/database
// options.backend_uri = "mysql://root:1234@:/test"; // options.backend_uri = "mysql://root:1234@:/test";
// options.path = "/tmp/vecwise_test"; // options.path = "/tmp/vecwise_test";
try {
options = getDBMetaOptions();
} catch(std::exception& ex) {
ASSERT_TRUE(false);
return;
}
int mode = Options::MODE::SINGLE; int mode = Options::MODE::SINGLE;
meta::MySQLMetaImpl impl(getDBMetaOptions(), mode); meta::MySQLMetaImpl impl(options, mode);
// auto status = impl.Initialize(); // auto status = impl.Initialize();
// ASSERT_TRUE(status.ok()); // ASSERT_TRUE(status.ok());
...@@ -192,9 +199,16 @@ TEST_F(MySQLTest, core) { ...@@ -192,9 +199,16 @@ TEST_F(MySQLTest, core) {
} }
TEST_F(MySQLTest, GROUP_TEST) { TEST_F(MySQLTest, GROUP_TEST) {
DBMetaOptions options;
try {
options = getDBMetaOptions();
} catch(std::exception& ex) {
ASSERT_TRUE(false);
return;
}
int mode = Options::MODE::SINGLE; int mode = Options::MODE::SINGLE;
meta::MySQLMetaImpl impl(getDBMetaOptions(), mode); meta::MySQLMetaImpl impl(options, mode);
auto table_id = "meta_test_group"; auto table_id = "meta_test_group";
...@@ -228,9 +242,16 @@ TEST_F(MySQLTest, GROUP_TEST) { ...@@ -228,9 +242,16 @@ TEST_F(MySQLTest, GROUP_TEST) {
} }
TEST_F(MySQLTest, table_file_TEST) { TEST_F(MySQLTest, table_file_TEST) {
DBMetaOptions options;
try {
options = getDBMetaOptions();
} catch(std::exception& ex) {
ASSERT_TRUE(false);
return;
}
int mode = Options::MODE::SINGLE; int mode = Options::MODE::SINGLE;
meta::MySQLMetaImpl impl(getDBMetaOptions(), mode); meta::MySQLMetaImpl impl(options, mode);
auto table_id = "meta_test_group"; auto table_id = "meta_test_group";
...@@ -296,7 +317,14 @@ TEST_F(MySQLTest, table_file_TEST) { ...@@ -296,7 +317,14 @@ TEST_F(MySQLTest, table_file_TEST) {
TEST_F(MySQLTest, ARCHIVE_TEST_DAYS) { TEST_F(MySQLTest, ARCHIVE_TEST_DAYS) {
srand(time(0)); srand(time(0));
DBMetaOptions options = getDBMetaOptions(); DBMetaOptions options;
try {
options = getDBMetaOptions();
} catch(std::exception& ex) {
ASSERT_TRUE(false);
return;
}
int days_num = rand() % 100; int days_num = rand() % 100;
std::stringstream ss; std::stringstream ss;
ss << "days:" << days_num; ss << "days:" << days_num;
...@@ -350,7 +378,14 @@ TEST_F(MySQLTest, ARCHIVE_TEST_DAYS) { ...@@ -350,7 +378,14 @@ TEST_F(MySQLTest, ARCHIVE_TEST_DAYS) {
} }
TEST_F(MySQLTest, ARCHIVE_TEST_DISK) { TEST_F(MySQLTest, ARCHIVE_TEST_DISK) {
DBMetaOptions options = getDBMetaOptions(); DBMetaOptions options;
try {
options = getDBMetaOptions();
} catch(std::exception& ex) {
ASSERT_TRUE(false);
return;
}
options.archive_conf = ArchiveConf("delete", "disk:11"); options.archive_conf = ArchiveConf("delete", "disk:11");
int mode = Options::MODE::SINGLE; int mode = Options::MODE::SINGLE;
auto impl = meta::MySQLMetaImpl(options, mode); auto impl = meta::MySQLMetaImpl(options, mode);
...@@ -397,9 +432,16 @@ TEST_F(MySQLTest, ARCHIVE_TEST_DISK) { ...@@ -397,9 +432,16 @@ TEST_F(MySQLTest, ARCHIVE_TEST_DISK) {
} }
TEST_F(MySQLTest, TABLE_FILES_TEST) { TEST_F(MySQLTest, TABLE_FILES_TEST) {
DBMetaOptions options;
try {
options = getDBMetaOptions();
} catch(std::exception& ex) {
ASSERT_TRUE(false);
return;
}
int mode = Options::MODE::SINGLE; int mode = Options::MODE::SINGLE;
auto impl = meta::MySQLMetaImpl(getDBMetaOptions(), mode); auto impl = meta::MySQLMetaImpl(options, mode);
auto table_id = "meta_test_group"; auto table_id = "meta_test_group";
......
...@@ -91,6 +91,11 @@ zilliz::milvus::engine::DBMetaOptions MySQLTest::getDBMetaOptions() { ...@@ -91,6 +91,11 @@ zilliz::milvus::engine::DBMetaOptions MySQLTest::getDBMetaOptions() {
zilliz::milvus::engine::DBMetaOptions options; zilliz::milvus::engine::DBMetaOptions options;
options.path = "/tmp/milvus_test"; options.path = "/tmp/milvus_test";
options.backend_uri = DBTestEnvironment::getURI(); options.backend_uri = DBTestEnvironment::getURI();
if(options.backend_uri.empty()) {
throw std::exception();
}
return options; return options;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册