|
33 | 33 | import org.elasticsearch.common.xcontent.XContentLocation;
|
34 | 34 | import org.elasticsearch.common.xcontent.XContentParser;
|
35 | 35 | import org.elasticsearch.common.xcontent.XContentParser.Token;
|
| 36 | +import org.elasticsearch.test.rest.ESRestTestCase; |
36 | 37 | import org.elasticsearch.test.rest.yaml.ClientYamlDocsTestClient;
|
37 | 38 | import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
|
38 | 39 | import org.elasticsearch.test.rest.yaml.ClientYamlTestClient;
|
|
41 | 42 | import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
|
42 | 43 | import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestSpec;
|
43 | 44 | import org.elasticsearch.test.rest.yaml.section.ExecutableSection;
|
| 45 | +import org.junit.After; |
44 | 46 |
|
45 | 47 | import java.io.IOException;
|
46 | 48 | import java.util.ArrayList;
|
@@ -97,6 +99,23 @@ protected ClientYamlTestClient initClientYamlTestClient(
|
97 | 99 | return new ClientYamlDocsTestClient(restSpec, restClient, hosts, esVersion, masterVersion, this::getClientBuilderWithSniffedHosts);
|
98 | 100 | }
|
99 | 101 |
|
| 102 | + @After |
| 103 | + public void cleanup() throws Exception { |
| 104 | + if (isMachineLearningTest() || isDataFrameTest()) { |
| 105 | + ESRestTestCase.waitForPendingTasks(adminClient()); |
| 106 | + } |
| 107 | + } |
| 108 | + |
| 109 | + protected boolean isMachineLearningTest() { |
| 110 | + String testName = getTestName(); |
| 111 | + return testName != null && (testName.contains("/ml/") || testName.contains("\\ml\\")); |
| 112 | + } |
| 113 | + |
| 114 | + protected boolean isDataFrameTest() { |
| 115 | + String testName = getTestName(); |
| 116 | + return testName != null && (testName.contains("/data-frames/") || testName.contains("\\data-frames\\")); |
| 117 | + } |
| 118 | + |
100 | 119 | /**
|
101 | 120 | * Compares the results of running two analyzers against many random
|
102 | 121 | * strings. The goal is to figure out if two anlayzers are "the same" by
|
|
0 commit comments