Skip to content

Commit

Permalink
Fix flaky remote cluster state UT (opensearch-project#10780)
Browse files Browse the repository at this point in the history
Signed-off-by: Dhwanil Patel <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
  • Loading branch information
dhwanilpatel authored and shiv0408 committed Apr 25, 2024
1 parent 567374a commit 76d55aa
Showing 1 changed file with 3 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,7 @@ 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 76d55aa

Please sign in to comment.