Skip to content

Commit

Permalink
[UT] Fix unstable CoordinatorBackendAssignerTest (StarRocks#55053)
Browse files Browse the repository at this point in the history
Signed-off-by: PengFei Li <[email protected]>
  • Loading branch information
banmoy authored Jan 14, 2025
1 parent d4b5b3c commit 4fdb7e4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,14 @@ private void runSchedule() {
task.getScheduleType(), task.getTaskId(), System.currentTimeMillis() - startTime, e);
throwable = e;
} finally {
// numExecutedTasks is just for testing. Should update it before calling task.finish()
// which may notify the waiting thread. So that after the thread wakes up, it can get
// the correct numExecutedTasks including this one.
numExecutedTasks.incrementAndGet();
task.finish(throwable);
if (task.getScheduleType() == EventType.DETECT_UNAVAILABLE_NODES) {
numPendingTasksForDetectUnavailableNodes.decrementAndGet();
}
numExecutedTasks.incrementAndGet();
}
}
}
Expand Down

0 comments on commit 4fdb7e4

Please sign in to comment.