Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 committed Dec 19, 2022
1 parent 71de42c commit caa0388
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public void testReleaseBrokenSession() {
new HostAddress(ip, 9670), new HostAddress(ip, 9671));
SessionPoolConfig config = new SessionPoolConfig(addresses, "space_for_session_pool",
"root", "nebula");
config.setHealthCheckTime(5);
SessionPool sessionPool = new SessionPool(config);
assert sessionPool.init();

Expand All @@ -291,6 +292,9 @@ public void testReleaseBrokenSession() {
p.waitFor(5, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(cmd, p);

// sleep 6 seconds to process the healthy check schedule task
Thread.sleep(6);

for (int i = 0; i < 10; i++) {
try {
ResultSet resultSet = sessionPool.execute("SHOW SPACES;");
Expand All @@ -313,8 +317,6 @@ public void testReleaseBrokenSession() {
try {
runtime.exec("docker start nebula-docker-compose_graphd0_1")
.waitFor(5, TimeUnit.SECONDS);
runtime.exec("docker start nebula-docker-compose_graphd1_1")
.waitFor(5, TimeUnit.SECONDS);
TimeUnit.SECONDS.sleep(5);
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit caa0388

Please sign in to comment.