Skip to content

Commit

Permalink
Fix flaky remote cluster state UT (#10784)
Browse files Browse the repository at this point in the history
Signed-off-by: Dhwanil Patel <[email protected]>
  • Loading branch information
dhwanilpatel authored Oct 22, 2023
1 parent 48b3f4d commit 0a934db
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,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 @@ -479,6 +479,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 @@ -1281,7 +1282,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

0 comments on commit 0a934db

Please sign in to comment.