Skip to content

Commit

Permalink
fix fe ut
Browse files Browse the repository at this point in the history
  • Loading branch information
yujun777 committed May 20, 2024
1 parent 4fa2bde commit 3268543
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,14 @@ public static void beforeClass() throws Exception {
System.out.println(runningDir);
FeConstants.runningUnitTest = true;
FeConstants.tablet_checker_interval_ms = 100;
Config.tablet_schedule_interval_ms = 100;
Config.tablet_repair_delay_factor_second = 1;
Config.colocate_group_relocate_delay_second = 1;
Config.schedule_slot_num_per_hdd_path = 1000;
Config.schedule_slot_num_per_ssd_path = 1000;
Config.schedule_slot_num_per_hdd_path = 10000;
Config.schedule_slot_num_per_ssd_path = 10000;
Config.schedule_batch_size = 10000;
Config.disable_colocate_balance_between_groups = true;
Config.max_scheduling_tablets = 10000;
Config.disable_balance = true;
// 5 backends:
// 127.0.0.1
Expand Down Expand Up @@ -321,7 +325,7 @@ public void test() throws Exception {
stmt = (AlterSystemStmt) UtFrameUtils.parseAndAnalyzeStmt(stmtStr, connectContext);
DdlExecutor.execute(Env.getCurrentEnv(), stmt);
Assert.assertEquals(tag2, be.getLocationTag());
ExceptionChecker.expectThrows(UserException.class, () -> tbl.checkReplicaAllocation());
Thread.sleep(5000);
checkTableReplicaAllocation(tbl);
Assert.assertEquals(90, invertedIndex.getReplicaMetaTable().cellSet().size());

Expand Down Expand Up @@ -383,7 +387,8 @@ public void test() throws Exception {
stmt = (AlterSystemStmt) UtFrameUtils.parseAndAnalyzeStmt(stmtStr, connectContext);
DdlExecutor.execute(Env.getCurrentEnv(), stmt);
Assert.assertEquals(tag1, be.getLocationTag());
ExceptionChecker.expectThrows(UserException.class, () -> tbl.checkReplicaAllocation());
Thread.sleep(5000);
tbl.checkReplicaAllocation();

checkTableReplicaAllocation(colTbl1);
checkTableReplicaAllocation(colTbl2);
Expand Down Expand Up @@ -573,8 +578,8 @@ private void checkTableReplicaAllocation(OlapTable tbl) throws InterruptedExcept
// it will increase the probability of map to throw NoSuchElementException exception.
System.out.println(e.getMessage());
}
Thread.sleep(1000);
System.out.println("wait table " + tbl.getId() + " to be stable");
Thread.sleep(1000);
}
ExceptionChecker.expectThrowsNoException(() -> tbl.checkReplicaAllocation());
System.out.println("table " + tbl.getId() + " is stable");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ public void run() {
if (address == null) {
System.out.println("fe addr thread race, please check it");
}
System.out.println(
"get agent task request. type: " + request.getTaskType() + ", signature: "
System.out.println(backend.getHost() + ":" + backend.getHeartbeatPort() + " "
+ "get agent task request. type: " + request.getTaskType() + ", signature: "
+ request.getSignature() + ", fe addr: " + address);
TFinishTaskRequest finishTaskRequest = new TFinishTaskRequest(tBackend,
request.getTaskType(), request.getSignature(), new TStatus(TStatusCode.OK));
Expand Down Expand Up @@ -312,7 +312,8 @@ public TTransmitDataResult transmitData(TTransmitDataParams params) throws TExce
public TAgentResult submitTasks(List<TAgentTaskRequest> tasks) throws TException {
for (TAgentTaskRequest request : tasks) {
taskQueue.add(request);
System.out.println("receive agent task request. type: " + request.getTaskType() + ", signature: "
System.out.println(backend.getHost() + ":" + backend.getHeartbeatPort() + " "
+ "receive agent task request. type: " + request.getTaskType() + ", signature: "
+ request.getSignature());
}
return new TAgentResult(new TStatus(TStatusCode.OK));
Expand Down

0 comments on commit 3268543

Please sign in to comment.