File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
server/src/internalClusterTest/java/org/opensearch/remotestore Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1084,7 +1084,7 @@ public void testCloseIndexWithNoOpSyncAndFlushForAsyncTranslog() throws Interrup
10841084
10851085 public void testSuccessfulShallowV1SnapshotPostIndexClose () throws Exception {
10861086 internalCluster ().startClusterManagerOnlyNode ();
1087- internalCluster ().startDataOnlyNodes (1 );
1087+ String dataNode = internalCluster ().startDataOnlyNodes (1 ). get ( 0 );
10881088 createIndex (INDEX_NAME , remoteStoreIndexSettings (0 , 10000L , -1 ));
10891089 ensureGreen (INDEX_NAME );
10901090
@@ -1143,5 +1143,17 @@ public void testSuccessfulShallowV1SnapshotPostIndexClose() throws Exception {
11431143 assertEquals (SnapshotState .SUCCESS , snapshotInfo2 .state ());
11441144 assertTrue (snapshotInfo2 .successfulShards () > 0 );
11451145 assertEquals (0 , snapshotInfo2 .failedShards ());
1146+
1147+ // delete the index
1148+ cluster ().wipeIndices (INDEX_NAME );
1149+ // try restoring the snapshot
1150+ RestoreSnapshotResponse restoreSnapshotResponse = clusterAdmin ().prepareRestoreSnapshot (shallowSnapshotRepoName , snapshot2 )
1151+ .setWaitForCompletion (true )
1152+ .execute ()
1153+ .actionGet ();
1154+ assertThat (restoreSnapshotResponse .getRestoreInfo ().totalShards (), greaterThan (0 ));
1155+ ensureGreen (INDEX_NAME );
1156+ flushAndRefresh (INDEX_NAME );
1157+ assertBusy (() -> { assertHitCount (client (dataNode ).prepareSearch (INDEX_NAME ).setSize (0 ).get (), 20 ); });
11461158 }
11471159}
You can’t perform that action at this time.
0 commit comments