Skip to content
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 @@ -455,9 +455,6 @@ tests:
- class: org.elasticsearch.search.SearchServiceSingleNodeTests
method: testLookUpSearchContext
issue: https://github.com/elastic/elasticsearch/issues/126813
- class: org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT
method: testRestoreSnapshotAllocationDoesNotExceedWatermarkWithMultipleRestores
issue: https://github.com/elastic/elasticsearch/issues/127286
- class: org.elasticsearch.test.index.IndexVersionUtilsTests
method: testIndexCompatibleVersionMatches
issue: https://github.com/elastic/elasticsearch/issues/120760
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