Add debug logging for testRunningTasksCount

Relates #53594
This commit is contained in:
Nhat Nguyen 2020-03-29 18:33:30 -04:00
parent d2aced810d
commit 6e025c12f0
1 changed files with 4 additions and 0 deletions

View File

@ -67,6 +67,7 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import static org.elasticsearch.action.support.PlainActionFuture.newFuture;
import static org.hamcrest.Matchers.containsString;
@ -307,6 +308,9 @@ public class TransportTasksActionTests extends TaskManagerTestCase {
// Check task counts using taskManager
Map<Long, Task> localTasks = testNodes[0].transportService.getTaskManager().getTasks();
logger.info("local tasks [{}]", localTasks.values().stream()
.map(t -> Strings.toString(t.taskInfo(testNodes[0].getNodeId(), true)))
.collect(Collectors.joining(",")));
assertEquals(2, localTasks.size()); // all node tasks + 1 coordinating task
Task coordinatingTask = localTasks.get(Collections.min(localTasks.keySet()));
Task subTask = localTasks.get(Collections.max(localTasks.keySet()));