File tree 1 file changed +10
-4
lines changed
server/src/internalClusterTest/java/org/opensearch/remotestore 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -310,10 +310,16 @@ private void validateCurrentMetadata() throws Exception {
310
310
internalCluster ().getClusterManagerName ()
311
311
);
312
312
assertBusy (() -> {
313
- ClusterMetadataManifest manifest = remoteClusterStateService .getLatestClusterMetadataManifest (
314
- getClusterState ().getClusterName ().value (),
315
- getClusterState ().metadata ().clusterUUID ()
316
- ).get ();
313
+ ClusterMetadataManifest manifest ;
314
+ try {
315
+ manifest = remoteClusterStateService .getLatestClusterMetadataManifest (
316
+ getClusterState ().getClusterName ().value (),
317
+ getClusterState ().metadata ().clusterUUID ()
318
+ ).get ();
319
+ } catch (IllegalStateException e ) {
320
+ // AssertionError helps us use assertBusy and retry validation if failed due to a race condition.
321
+ throw new AssertionError ("Error while validating latest cluster metadata" , e );
322
+ }
317
323
ClusterState clusterState = getClusterState ();
318
324
Metadata currentMetadata = clusterState .metadata ();
319
325
assertEquals (currentMetadata .indices ().size (), manifest .getIndices ().size ());
You can’t perform that action at this time.
0 commit comments