Skip to content

Fix assertion in DiskThresholdDeciderIT.testRestoreSnapshotAllocationDoesNotExceedWatermarkWithMultipleRestores #127615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,6 @@ tests:
- class: org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterIT
method: testRestart {p0=true p1=true}
issue: https://github.com/elastic/elasticsearch/issues/127595
- class: org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT
method: testRestoreSnapshotAllocationDoesNotExceedWatermarkWithMultipleRestores
issue: https://github.com/elastic/elasticsearch/issues/127286
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
method: test {p0=ml/data_frame_analytics_cat_apis/Test cat data frame analytics all jobs with header}
issue: https://github.com/elastic/elasticsearch/issues/127625
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.in;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
Expand Down Expand Up @@ -242,7 +241,7 @@ public void testRestoreSnapshotAllocationDoesNotExceedWatermarkWithMultipleResto
clusterAdmin().prepareRestoreSnapshot(TEST_REQUEST_TIMEOUT, "repo", "snap")
.setWaitForCompletion(true)
.setRenamePattern(indexName)
.setRenameReplacement(indexName + "-copy")
.setRenameReplacement(copyIndexName)
.execute(ActionTestUtils.assertNoFailureListener(restoreSnapshotResponse -> {
final RestoreInfo restoreInfo = restoreSnapshotResponse.getRestoreInfo();
assertThat(restoreInfo.successfulShards(), is(snapshotInfo.totalShards()));
Expand All @@ -268,10 +267,19 @@ public void testRestoreSnapshotAllocationDoesNotExceedWatermarkWithMultipleResto

// wait for all the shards to finish moving
safeAwait(allShardsActiveListener);
ensureGreen(indexName, indexName + "-copy");
ensureGreen(indexName, copyIndexName);

final var tinyNodeShardIds = getShardIds(dataNodeId, indexName);
assertThat(tinyNodeShardIds, hasSize(1));
final var tinyNodeShardIdsCopy = getShardIds(dataNodeId, copyIndexName);
assertThat(
"expected just one shard from one index on the tiny node, instead got "
+ tinyNodeShardIds
+ " from the original index and "
+ tinyNodeShardIdsCopy
+ " from the copy",
tinyNodeShardIds.size() + tinyNodeShardIdsCopy.size(),
is(1)
);
assertThat(tinyNodeShardIds.iterator().next(), in(shardSizes.getShardIdsWithSizeSmallerOrEqual(usableSpace)));
}

Expand Down