Skip to content
Snippets Groups Projects
Commit 8b14f10d authored by dangleptr's avatar dangleptr Committed by GitHub
Browse files

Use active hosts when creating space (#425)

* Use active hosts when creating space

* x
parent 12b62cf8
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
#include "base/Base.h"
#include "graph/test/TestEnv.h"
#include "graph/test/TestBase.h"
#include "meta/test/TestUtils.h"
DECLARE_int32(load_data_interval_secs);
......@@ -34,6 +35,8 @@ TEST_F(SchemaTest, metaCommunication) {
std::string query = "ADD HOSTS 127.0.0.1:1000, 127.0.0.1:1100";
auto code = client->execute(query, resp);
ASSERT_EQ(cpp2::ErrorCode::SUCCEEDED, code);
meta::TestUtils::registerHB(
network::NetworkUtils::toHosts("127.0.0.1:1000, 127.0.0.1:1100").value());
}
{
cpp2::ExecutionResponse resp;
......@@ -54,7 +57,7 @@ TEST_F(SchemaTest, metaCommunication) {
}
{
cpp2::ExecutionResponse resp;
std::string query = "CREATE SPACE default_space(partition_num=9, replica_factor=3)";
std::string query = "CREATE SPACE default_space(partition_num=9, replica_factor=1)";
auto code = client->execute(query, resp);
ASSERT_EQ(cpp2::ErrorCode::SUCCEEDED, code);
}
......@@ -65,7 +68,7 @@ TEST_F(SchemaTest, metaCommunication) {
auto code = client->execute(query, resp);
ASSERT_EQ(cpp2::ErrorCode::SUCCEEDED, code);
std::vector<std::tuple<int, std::string, int, int>> expected{
{1, "default_space", 9, 3},
{1, "default_space", 9, 1},
};
ASSERT_TRUE(verifyResult(resp, expected));
}
......@@ -235,7 +238,7 @@ TEST_F(SchemaTest, metaCommunication) {
}
{
cpp2::ExecutionResponse resp;
std::string query = "CREATE SPACE my_space(partition_num=9, replica_factor=3)";
std::string query = "CREATE SPACE my_space(partition_num=9, replica_factor=1)";
auto code = client->execute(query, resp);
ASSERT_EQ(cpp2::ErrorCode::SUCCEEDED, code);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment