Skip to content

Commit ab55d97

Browse files
authored
Fix DataStreamLifecycleDownsampleIT.testUpdateDownsampleSamplingMode (#138174)
It was clear from failed tests that DLM was still progressing when the timeout of 10s was reached. Since DLM works on a poll interval (set to 1s in these tests), there's not much we can do to speed up the test. Therefore, we simply bump the timeout from 10s to 30s. This should give DLM enough time to complete the downsampling mode change. Note that `safeAwait` uses a timeout of 10s and `awaitClusterState` uses a timeout of 30s; that's why there's no explicit timeout change. Fixes #138135
1 parent f86f58f commit ab55d97

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,6 @@ tests:
453453
- class: org.elasticsearch.upgrades.IndexSortUpgradeIT
454454
method: testIndexSortForNumericTypes {upgradedNodes=1}
455455
issue: https://github.com/elastic/elasticsearch/issues/138130
456-
- class: org.elasticsearch.xpack.downsample.DataStreamLifecycleDownsampleIT
457-
method: testUpdateDownsampleSamplingMode
458-
issue: https://github.com/elastic/elasticsearch/issues/138135
459456
- class: org.elasticsearch.xpack.inference.integration.CCMServiceIT
460457
method: testCreatesEisChatCompletionEndpoint
461458
issue: https://github.com/elastic/elasticsearch/issues/138206

x-pack/plugin/downsample/src/internalClusterTest/java/org/elasticsearch/xpack/downsample/DataStreamLifecycleDownsampleIT.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.elasticsearch.core.TimeValue;
2222
import org.elasticsearch.datastreams.lifecycle.DataStreamLifecycleService;
2323
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
24-
import org.elasticsearch.test.ClusterServiceUtils;
2524
import org.elasticsearch.test.junit.annotations.TestLogging;
2625

2726
import java.util.HashSet;
@@ -352,17 +351,15 @@ public void testUpdateDownsampleSamplingMode() throws Exception {
352351
rolloverResponse = safeGet(client().execute(RolloverAction.INSTANCE, new RolloverRequest(dataStreamName, null)));
353352
assertTrue(rolloverResponse.isRolledOver());
354353
String downsampledPrefix = "downsample-10m-";
355-
final var waitForUpdatedDownsamplingRound = ClusterServiceUtils.addMasterTemporaryStateListener(clusterState -> {
354+
awaitClusterState(clusterState -> {
356355
ProjectMetadata projectMetadata = clusterState.metadata().getProject();
357356
final var dataStream = projectMetadata.dataStreams().get(dataStreamName);
358357
if (dataStream == null) {
359358
return false;
360359
}
361-
362360
return dataStream.getIndices().size() > 2
363361
&& dataStream.getIndices().stream().filter(index -> index.getName().startsWith(downsampledPrefix)).count() == 2;
364362
});
365-
safeAwait(waitForUpdatedDownsamplingRound);
366363
assertDownsamplingMethod(initialSamplingMethod, downsampledPrefix + firstBackingIndex);
367364
assertDownsamplingMethod(updatedSamplingMethod, downsampledPrefix + secondBackingIndex);
368365
}

0 commit comments

Comments
 (0)