Skip to content

Commit a520bc6

Browse files
committed
Fix test
1 parent f40f86f commit a520bc6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.elasticsearch.common.settings.Setting;
3434
import org.elasticsearch.common.settings.Settings;
3535
import org.elasticsearch.common.util.concurrent.EsExecutors;
36+
import org.elasticsearch.core.FixForMultiProject;
3637
import org.elasticsearch.core.TimeValue;
3738
import org.elasticsearch.env.NodeEnvironment;
3839
import org.elasticsearch.env.ShardLockObtainFailedException;
@@ -546,7 +547,8 @@ public void testIndexAndTombstoneWithSameNameOnStartup() throws Exception {
546547
.build();
547548
final Index tombstonedIndex = new Index(indexName, UUIDs.randomBase64UUID());
548549
final IndexGraveyard graveyard = IndexGraveyard.builder().addTombstone(tombstonedIndex).build();
549-
final var project = ProjectMetadata.builder(randomProjectIdOrDefault()).put(indexMetadata, true).indexGraveyard(graveyard).build();
550+
@FixForMultiProject // Use random project-id
551+
final var project = ProjectMetadata.builder(ProjectId.DEFAULT).put(indexMetadata, true).indexGraveyard(graveyard).build();
550552
final ClusterState clusterState = new ClusterState.Builder(new ClusterName("testCluster")).putProjectMetadata(project).build();
551553
// if all goes well, this won't throw an exception, otherwise, it will throw an IllegalStateException
552554
indicesService.verifyIndexIsDeleted(tombstonedIndex, clusterState);

0 commit comments

Comments
 (0)