mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
Rethrottle tests wait for task to start (#77822)
Improved how we wait for tasks to really start, to ensure that rethrottle does not fail the test. Closes #75327
This commit is contained in:
parent
286cd3516c
commit
3cad9c1c39
1 changed files with 2 additions and 1 deletions
|
@ -336,7 +336,8 @@ public abstract class ESRestHighLevelClientTestCase extends ESRestTestCase {
|
|||
TaskGroup taskGroup = taskGroups.get(0);
|
||||
assertThat(taskGroup.getChildTasks(), empty());
|
||||
// check that the task initialized enough that it can rethrottle too.
|
||||
if (((RawTaskStatus) taskGroup.getTaskInfo().getStatus()).toMap().containsKey("batches")) {
|
||||
Map<String, Object> statusMap = ((RawTaskStatus) taskGroup.getTaskInfo().getStatus()).toMap();
|
||||
if (statusMap.get("batches").equals(1)) {
|
||||
return taskGroup.getTaskInfo().getTaskId();
|
||||
}
|
||||
} while (System.nanoTime() - start < TimeUnit.SECONDS.toNanos(10));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue