Skip to content

Commit

Permalink
[ML] [Data Frame] Adding pending task wait to the hlrc cleanup (elast…
Browse files Browse the repository at this point in the history
  • Loading branch information
benwtrent authored and alpar-t committed Jun 10, 2019
1 parent ef02a08 commit 0fe1948
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private void indexData(String indexName) throws IOException {
}

@After
public void cleanUpTransforms() throws IOException {
public void cleanUpTransforms() throws Exception {
for (String transformId : transformsToClean) {
highLevelClient().dataFrame().stopDataFrameTransform(
new StopDataFrameTransformRequest(transformId, Boolean.TRUE, null), RequestOptions.DEFAULT);
Expand All @@ -152,6 +152,7 @@ public void cleanUpTransforms() throws IOException {
}

transformsToClean = new ArrayList<>();
waitForPendingTasks(adminClient());
}

public void testCreateDelete() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class DataFrameTransformDocumentationIT extends ESRestHighLevelClientTest
private List<String> transformsToClean = new ArrayList<>();

@After
public void cleanUpTransforms() throws IOException {
public void cleanUpTransforms() throws Exception {
for (String transformId : transformsToClean) {
highLevelClient().dataFrame().stopDataFrameTransform(
new StopDataFrameTransformRequest(transformId, Boolean.TRUE, TimeValue.timeValueSeconds(20)), RequestOptions.DEFAULT);
Expand All @@ -86,6 +86,7 @@ public void cleanUpTransforms() throws IOException {
}

transformsToClean = new ArrayList<>();
waitForPendingTasks(adminClient());
}

private void createIndex(String indexName) throws IOException {
Expand Down

0 comments on commit 0fe1948

Please sign in to comment.