Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
heng committed May 17, 2019
1 parent 8e15d5c commit 4790646
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/graph/test/SchemaTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ TEST_F(SchemaTest, metaCommunication) {
auto code = client->execute(query, resp);
ASSERT_NE(cpp2::ErrorCode::SUCCEEDED, code);
}
sleep(FLAGS_load_data_interval_second + 1);
sleep(FLAGS_load_data_interval_secs + 1);
{
cpp2::ExecutionResponse resp;
std::string query = "DESCRIBE EDGE education";
Expand Down
4 changes: 2 additions & 2 deletions src/meta/test/MetaHttpHandlerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "meta/test/TestUtils.h"
#include "fs/TempDir.h"

DECLARE_int32(load_data_interval_second);
DECLARE_int32(load_data_interval_secs);
DECLARE_string(pid_file);

namespace nebula {
Expand Down Expand Up @@ -42,7 +42,7 @@ class MetaHttpHandlerTestEnv : public ::testing::Environment {


TEST(MetaHttpHandlerTest, MetaStatusTest) {
FLAGS_load_data_interval_second = 1;
FLAGS_load_data_interval_secs = 1;
fs::TempDir rootPath("/tmp/MetaClientTest.XXXXXX");
auto sc = TestUtils::mockServer(10001, rootPath.path());

Expand Down
15 changes: 11 additions & 4 deletions src/storage/test/StorageHttpHandlerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "fs/TempDir.h"

DECLARE_string(meta_server_addrs);
DECLARE_int32(load_data_interval_second);
DECLARE_int32(load_data_interval_secs);

namespace nebula {

Expand Down Expand Up @@ -43,22 +43,29 @@ class StorageHttpHandlerTestEnv : public ::testing::Environment {


TEST(StoragehHttpHandlerTest, StorageStatusTest) {
FLAGS_load_data_interval_second = 1;
FLAGS_load_data_interval_secs = 1;

fs::TempDir rootPath("/tmp/StorageClientTest.XXXXXX");
uint32_t localIp;
network::NetworkUtils::ipv4ToInt("127.0.0.1", localIp);
uint32_t localMetaPort = 10001;
uint32_t localDataPort = 20002;
FLAGS_meta_server_addrs = folly::stringPrintf("127.0.0.1:%d", localMetaPort);

LOG(INFO) << "Start meta server....";
std::string metaPath = folly::stringPrintf("%s/meta", rootPath.path());
auto metaServerContext = meta::TestUtils::mockServer(localMetaPort, metaPath.c_str());

LOG(INFO) << "Start storage server....";
auto threadPool = std::make_shared<folly::IOThreadPoolExecutor>(1);
auto addrsRet
= network::NetworkUtils::toHosts(folly::stringPrintf("127.0.0.1:%d", localMetaPort));
CHECK(addrsRet.ok()) << addrsRet.status();
auto mClient
= std::make_unique<meta::MetaClient>(threadPool, std::move(addrsRet.value()), true);
mClient->init();
std::string dataPath = folly::stringPrintf("%s/data", rootPath.path());
auto sc = TestUtils::mockServer(dataPath.c_str(),
auto sc = TestUtils::mockServer(mClient.get(),
dataPath.c_str(),
localIp,
localDataPort);

Expand Down

0 comments on commit 4790646

Please sign in to comment.