Skip to content

Commit 0198e3d

Browse files
committed
Update LoadBalanceTest.java
1 parent 73a630b commit 0198e3d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/com/xxdb/LoadBalanceTest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public void Test_getConnection_enableHighAvailability_true_conn_high_load() thro
255255
conn.connect(HOST, PORT, "admin", "123456", "", true,ipports);
256256
list1.add(conn);
257257
}
258+
connection1.run("sleep(3000)");
258259
BasicTable re1 = (BasicTable)connection1.run("select port ,connectionNum from rpc(getControllerAlias(),getClusterPerf) where mode= 0");
259260
for (int i = 0; i < re1.rows(); i++) {
260261
System.out.println("port:"+ re1.getColumn(0).get(i)+" connectionNum:"+re1.getColumn(1).get(i));
@@ -296,6 +297,7 @@ public void Test_getConnection_enableHighAvailability_true_all_note_conn_high_lo
296297
conn.connect(HOST, PORT, "admin", "123456", "", true,ipports);
297298
list1.add(conn);
298299
}
300+
connection1.run("sleep(3000)");
299301
BasicTable re2 = (BasicTable)connection1.run("select port ,connectionNum from rpc(getControllerAlias(),getClusterPerf) where mode= 0");
300302
for (int i = 0; i < re2.rows(); i++) {
301303
System.out.println("port:"+ re2.getColumn(0).get(i)+" connectionNum:"+re2.getColumn(1).get(i));
@@ -314,6 +316,7 @@ public void Test_getConnection_enableHighAvailability_false_1() throws SQLExcept
314316
}
315317
DBConnection connection1 = new DBConnection();
316318
connection1.connect(HOST, controller_port, "admin", "123456",true);
319+
connection1.run("sleep(3000)");
317320
BasicTable re = (BasicTable)connection1.run("select port ,connectionNum from rpc(getControllerAlias(),getClusterPerf) where mode= 0");
318321
for (int i = 0; i < re.rows(); i++) {
319322
System.out.println("port:"+ re.getColumn(0).get(i)+" connectionNum:"+re.getColumn(1).get(i));
@@ -336,6 +339,7 @@ public void Test_getConnection_enableHighAvailability_true_site_null_all_note_lo
336339
}
337340
DBConnection connection1 = new DBConnection();
338341
connection1.connect(HOST, PORT, "admin", "123456",true);
342+
connection1.run("sleep(3000)");
339343
BasicTable re = (BasicTable)connection1.run("select port ,connectionNum from rpc(getControllerAlias(),getClusterPerf) where mode= 0");
340344
for (int i = 0; i < re.rows(); i++) {
341345
System.out.println("port:"+ re.getColumn(0).get(i)+" connectionNum:"+re.getColumn(1).get(i));
@@ -357,6 +361,7 @@ public void Test_getConnection_enableHighAvailability_true_site_not_null_all_not
357361
}
358362
DBConnection connection1 = new DBConnection();
359363
connection1.connect(HOST, PORT, "admin", "123456", true);
364+
connection1.run("sleep(3000)");
360365
BasicTable re = (BasicTable) connection1.run("select port ,connectionNum from rpc(getControllerAlias(),getClusterPerf) where mode= 0");
361366
for (int i = 0; i < re.rows(); i++) {
362367
System.out.println("port:" + re.getColumn(0).get(i) + " connectionNum:" + re.getColumn(1).get(i));
@@ -376,7 +381,7 @@ public void Test_getConnection_enableHighAvailability_false_enableLoadBalance_fa
376381
}
377382
DBConnection connection1 = new DBConnection();
378383
connection1.connect(HOST, PORT, "admin", "123456",false);
379-
connection1.run("sleep(1000)");
384+
connection1.run("sleep(3000)");
380385
BasicIntVector re = (BasicIntVector)connection1.run("EXEC connectionNum from rpc(getControllerAlias(),getClusterPerf) where port="+PORT);
381386
System.out.println(re.getInt(0));
382387
assertEquals(true,re.getInt(0)>100);
@@ -391,6 +396,7 @@ public void Test_getConnection_enableHighAvailability_false_enableLoadBalance_nu
391396
}
392397
DBConnection connection1 = new DBConnection();
393398
connection1.connect(HOST, PORT, "admin", "123456",false);
399+
connection1.run("sleep(3000)");
394400
BasicIntVector re = (BasicIntVector)connection1.run("EXEC connectionNum from rpc(getControllerAlias(),getClusterPerf) where port="+PORT);
395401
System.out.println(re.getInt(0));
396402
assertEquals(true,re.getInt(0)>100);
@@ -405,6 +411,7 @@ public void Test_getConnection_enableHighAvailability_true_enableLoadBalance_fal
405411
}
406412
DBConnection connection1 = new DBConnection();
407413
connection1.connect(HOST, PORT, "admin", "123456",false);
414+
connection1.run("sleep(3000)");
408415
BasicIntVector re = (BasicIntVector)connection1.run("EXEC connectionNum from rpc(getControllerAlias(),getClusterPerf) where port="+PORT);
409416
System.out.println(re.getInt(0));
410417
assertEquals(true,re.getInt(0)>100);
@@ -422,7 +429,7 @@ public void Test_getConnection_enableHighAvailability_true_enableLoadBalance_fal
422429
list.add(connection);
423430
}
424431
controller_conn.run("try{startDataNode('"+HOST+":"+PORT+"')}catch(ex){}");
425-
controller_conn.run("sleep(2000);");
432+
controller_conn.run("sleep(3000);");
426433
DBConnection connection1 = new DBConnection();
427434
connection1.connect(HOST, PORT, "admin", "123456",false);
428435
int port1 = port_list[1];
@@ -446,6 +453,7 @@ public void Test_getConnection_enableHighAvailability_true_enableLoadBalance_tru
446453
}
447454
DBConnection connection1 = new DBConnection();
448455
connection1.connect(HOST, PORT, "admin", "123456",true);
456+
connection1.run("sleep(3000)");
449457
BasicTable re = (BasicTable) connection1.run("select port ,connectionNum from rpc(getControllerAlias(),getClusterPerf) where mode= 0");
450458
for (int i = 0; i < re.rows(); i++) {
451459
System.out.println("port:" + re.getColumn(0).get(i) + " connectionNum:" + re.getColumn(1).get(i));
@@ -469,6 +477,7 @@ public void Test_getConnection_enableHighAvailability_true_enableLoadBalance_tru
469477
controller_conn.run("try{startDataNode('"+HOST+":"+PORT+"')}catch(ex){}");
470478
DBConnection connection1 = new DBConnection();
471479
connection1.connect(HOST, PORT, "admin", "123456",false);
480+
connection1.run("sleep(3000)");
472481
BasicTable re = (BasicTable) connection1.run("select port ,connectionNum from rpc(getControllerAlias(),getClusterPerf) where mode= 0");
473482
for (int i = 0; i < re.rows(); i++) {
474483
System.out.println("port:" + re.getColumn(0).get(i) + " connectionNum:" + re.getColumn(1).get(i));

0 commit comments

Comments
 (0)