|
36 | 36 | import org.junit.After; |
37 | 37 | import org.junit.Assert; |
38 | 38 | import org.junit.Before; |
| 39 | +import org.junit.Rule; |
39 | 40 |
|
40 | 41 | import java.io.ByteArrayOutputStream; |
41 | 42 | import java.io.IOException; |
|
76 | 77 |
|
77 | 78 | public abstract class RestEsqlTestCase extends ESRestTestCase { |
78 | 79 |
|
| 80 | + @Rule(order = Integer.MIN_VALUE) |
| 81 | + public ProfileLogger profileLogger = new ProfileLogger(); |
| 82 | + |
79 | 83 | // Test runner will run multiple suites in parallel, with some of them requiring preserving state between |
80 | 84 | // tests (like EsqlSpecTestCase), so test data (like index name) needs not collide and cleanup must be done locally. |
81 | 85 | private static final String TEST_INDEX_NAME = "rest-esql-test"; |
@@ -455,7 +459,7 @@ public void testOutOfRangeComparisons() throws IOException { |
455 | 459 | "Line 1:29: java.lang.IllegalArgumentException: single-value function encountered multi-value" |
456 | 460 | ) |
457 | 461 | ); |
458 | | - var result = runEsql(query, assertWarnings, mode); |
| 462 | + var result = runEsql(query, assertWarnings, profileLogger, mode); |
459 | 463 |
|
460 | 464 | var values = as(result.get("values"), ArrayList.class); |
461 | 465 | assertThat( |
@@ -525,7 +529,7 @@ public void testInternalRange() throws IOException { |
525 | 529 |
|
526 | 530 | for (String p : predicates) { |
527 | 531 | var query = requestObjectBuilder().query(format(null, "from {} | where {}", testIndexName(), p)); |
528 | | - var result = runEsql(query, new AssertWarnings.NoWarnings(), mode); |
| 532 | + var result = runEsql(query, new AssertWarnings.NoWarnings(), profileLogger, mode); |
529 | 533 | var values = as(result.get("values"), ArrayList.class); |
530 | 534 | assertThat( |
531 | 535 | format(null, "Comparison [{}] should return all rows with single values.", p), |
@@ -1240,7 +1244,7 @@ private static String expectedTextBody(String format, int count, @Nullable Chara |
1240 | 1244 | } |
1241 | 1245 |
|
1242 | 1246 | public Map<String, Object> runEsql(RequestObjectBuilder requestObject) throws IOException { |
1243 | | - return runEsql(requestObject, new AssertWarnings.NoWarnings(), mode); |
| 1247 | + return runEsql(requestObject, new AssertWarnings.NoWarnings(), profileLogger, mode); |
1244 | 1248 | } |
1245 | 1249 |
|
1246 | 1250 | public static Map<String, Object> runEsqlSync(RequestObjectBuilder requestObject) throws IOException { |
|
0 commit comments