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 @@ -403,9 +403,6 @@ tests:
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=mtermvectors/10_basic/Tests catching other exceptions per item}
issue: https://github.com/elastic/elasticsearch/issues/122414
- class: org.elasticsearch.cluster.ClusterStateSerializationTests
method: testSerializationPreMultiProject
issue: https://github.com/elastic/elasticsearch/issues/130872
- class: org.elasticsearch.search.SearchWithRejectionsIT
method: testOpenContextsAfterRejections
issue: https://github.com/elastic/elasticsearch/issues/130821
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.elasticsearch.cluster.metadata;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.cluster.ClusterModule;
import org.elasticsearch.cluster.Diff;
import org.elasticsearch.cluster.coordination.CoordinationMetadata;
Expand Down Expand Up @@ -45,6 +46,7 @@
import org.elasticsearch.persistent.PersistentTasksService;
import org.elasticsearch.test.AbstractChunkedSerializingTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.TransportVersionUtils;
import org.elasticsearch.test.index.IndexVersionUtils;
import org.elasticsearch.test.rest.ObjectPath;
import org.elasticsearch.threadpool.ThreadPool;
Expand Down Expand Up @@ -613,6 +615,17 @@ public void testMultiProjectSerialization() throws IOException {
}
}

public void testUnableToSerializeNonDefaultProjectBeforeMultiProject() {
final var projectId = randomUniqueProjectId();
Metadata metadata = Metadata.builder().put(ProjectMetadata.builder(projectId)).build();

try (BytesStreamOutput output = new BytesStreamOutput()) {
output.setTransportVersion(TransportVersionUtils.getPreviousVersion(TransportVersions.MULTI_PROJECT));
var e = assertThrows(UnsupportedOperationException.class, () -> metadata.writeTo(output));
assertEquals("There is 1 project, but it has id [" + projectId + "] rather than default", e.getMessage());
}
}

public void testGetNonExistingProjectThrows() {
final List<ProjectMetadata> projects = IntStream.range(0, between(1, 3))
.mapToObj(i -> randomProject(ProjectId.fromId("p_" + i), between(0, 5)))
Expand Down