Skip to content
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

[Backport 2.x] Fix flaky remote cluster state UT #10784

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public void testGlobalMetadataOnlyUpdated() throws IOException {
mockBlobStoreObjects();
final CoordinationMetadata coordinationMetadata = CoordinationMetadata.builder().term(1L).build();
final ClusterState initialClusterState = ClusterState.builder(ClusterName.DEFAULT)
.metadata(Metadata.builder().coordinationMetadata(coordinationMetadata))
.metadata(Metadata.builder().coordinationMetadata(coordinationMetadata).version(randomNonNegativeLong()))
.build();
final ClusterMetadataManifest initialManifest = ClusterMetadataManifest.builder()
.codecVersion(2)
Expand All @@ -475,6 +475,7 @@ public void testGlobalMetadataOnlyUpdated() throws IOException {
// new cluster state where only global metadata is different
Metadata newMetadata = Metadata.builder(clusterState.metadata())
.persistentSettings(Settings.builder().put("cluster.blocks.read_only", true).build())
.version(randomNonNegativeLong())
.build();
ClusterState newClusterState = ClusterState.builder(clusterState).metadata(newMetadata).build();

Expand Down Expand Up @@ -1247,7 +1248,12 @@ private static ClusterState.Builder generateClusterStateWithOneIndex() {
.version(1L)
.stateUUID("state-uuid")
.metadata(
Metadata.builder().put(indexMetadata, true).clusterUUID("cluster-uuid").coordinationMetadata(coordinationMetadata).build()
Metadata.builder()
.version(randomNonNegativeLong())
.put(indexMetadata, true)
.clusterUUID("cluster-uuid")
.coordinationMetadata(coordinationMetadata)
.build()
);
}

Expand Down
Loading