Skip to content

Commit 57fbbcb

Browse files
authored
Fix leak in TimeSeriesRateAggregatorTests (#115345)
Fixes #115334
1 parent 157c983 commit 57fbbcb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

muted-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,6 @@ tests:
317317
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
318318
method: test {p0=esql/60_usage/Basic ESQL usage output (telemetry)}
319319
issue: https://github.com/elastic/elasticsearch/issues/115231
320-
- class: org.elasticsearch.xpack.analytics.rate.TimeSeriesRateAggregatorTests
321-
issue: https://github.com/elastic/elasticsearch/issues/115334
322320
- class: org.elasticsearch.xpack.watcher.trigger.schedule.engine.TickerScheduleEngineTests
323321
method: testAddWithNoLastCheckedTimeButHasActivationTimeExecutesBeforeInitialInterval
324322
issue: https://github.com/elastic/elasticsearch/issues/115339

x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/TimeSeriesRateAggregatorTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,12 @@ public void testNestedWithinAutoDateHistogram() throws IOException {
156156
AggTestConfig aggTestConfig = new AggTestConfig(tsBuilder, timeStampField(), counterField("counter_field"))
157157
.withSplitLeavesIntoSeperateAggregators(false);
158158
expectThrows(IllegalArgumentException.class, () -> testCase(iw -> {
159-
iw.addDocuments(docs(2000, "1", 15, 37, 60, /*reset*/ 14));
160-
iw.addDocuments(docs(2000, "2", 74, 150, /*reset*/ 50, 90, /*reset*/ 40));
159+
for (Document document : docs(2000, "1", 15, 37, 60, /*reset*/ 14)) {
160+
iw.addDocument(document);
161+
}
162+
for (Document document : docs(2000, "2", 74, 150, /*reset*/ 50, 90, /*reset*/ 40)) {
163+
iw.addDocument(document);
164+
}
161165
}, verifier, aggTestConfig));
162166
}
163167

0 commit comments

Comments
 (0)