Skip to content

Commit

Permalink
MetaClientTest.HeartbeatTest may be hung (vesoft-inc#2296)
Browse files Browse the repository at this point in the history
Co-authored-by: dangleptr <37216992+dangleptr@users.noreply.github.com>
  • Loading branch information
2 people authored and xuguruogu committed Aug 17, 2020
1 parent 38bd072 commit a925b57
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/meta/test/MetaClientTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,9 @@ TEST(MetaClientTest, HeartbeatTest) {
FLAGS_heartbeat_interval_secs = 1;
const nebula::ClusterID kClusterId = 10;
fs::TempDir rootPath("/tmp/MetaClientTest.XXXXXX");
auto sc = TestUtils::mockMetaServer(10001, rootPath.path(), kClusterId);
// Let the system choose an available port for us
int32_t localMetaPort = 0;
auto sc = TestUtils::mockMetaServer(localMetaPort, rootPath.path(), kClusterId);

auto threadPool = std::make_shared<folly::IOThreadPoolExecutor>(1);
IPv4 localIp;
Expand All @@ -1163,8 +1165,7 @@ TEST(MetaClientTest, HeartbeatTest) {
options.clusterId_ = kClusterId;
options.inStoraged_ = true;
auto client = std::make_shared<MetaClient>(threadPool,
std::vector<HostAddr>{HostAddr(localIp, 10001)},
options);
std::vector<HostAddr>{HostAddr(localIp, sc->port_)}, options);
client->waitForMetadReady();
client->registerListener(listener.get());
{
Expand Down

0 comments on commit a925b57

Please sign in to comment.