Skip to content

Commit 440c131

Browse files
committed
Fix integ test
Signed-off-by: Sooraj Sinha <[email protected]>
1 parent 8f79550 commit 440c131

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreClusterStateRestoreIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.opensearch.common.action.ActionFuture;
3434
import org.opensearch.common.settings.Setting;
3535
import org.opensearch.common.settings.Settings;
36-
import org.opensearch.common.util.concurrent.UncategorizedExecutionException;
3736
import org.opensearch.gateway.remote.ClusterMetadataManifest;
3837
import org.opensearch.gateway.remote.ClusterMetadataManifest.UploadedIndexMetadata;
3938
import org.opensearch.gateway.remote.RemoteClusterStateService;
@@ -43,6 +42,7 @@
4342
import org.opensearch.test.OpenSearchIntegTestCase;
4443
import org.junit.Before;
4544

45+
import java.io.IOError;
4646
import java.io.IOException;
4747
import java.nio.file.Files;
4848
import java.nio.file.Path;
@@ -313,7 +313,6 @@ public void testFullClusterRestoreMultipleIndices() throws Exception {
313313
updateIndexBlock(false, secondIndexName);
314314
}
315315

316-
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/pull/15950")
317316
public void testFullClusterRestoreManifestFilePointsToInvalidIndexMetadataPathThrowsException() throws Exception {
318317
int shardCount = randomIntBetween(1, 2);
319318
int replicaCount = 1;
@@ -341,10 +340,11 @@ public void testFullClusterRestoreManifestFilePointsToInvalidIndexMetadataPathTh
341340
for (UploadedIndexMetadata md : manifest.getIndices()) {
342341
Files.move(segmentRepoPath.resolve(md.getUploadedFilename()), segmentRepoPath.resolve("cluster-state/"));
343342
}
343+
internalCluster().stopAllNodes();
344344
} catch (IOException e) {
345345
throw new RuntimeException(e);
346346
}
347-
assertThrows(UncategorizedExecutionException.class, () -> addNewNodes(dataNodeCount, clusterManagerNodeCount));
347+
assertThrows(IOError.class, () -> internalCluster().client());
348348
// Test is complete
349349

350350
// Starting a node without remote state to ensure test cleanup

server/src/main/java/org/opensearch/gateway/GatewayMetaState.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ public class GatewayMetaState implements Closeable {
109109
*/
110110
public static final String STALE_STATE_CONFIG_NODE_ID = "STALE_STATE_CONFIG";
111111

112+
private final Logger logger = LogManager.getLogger(GatewayMetaState.class);
113+
112114
private PersistedStateRegistry persistedStateRegistry;
113115

114116
public PersistedState getPersistedState() {
@@ -260,9 +262,10 @@ private ClusterState restoreClusterStateWithRetries(
260262
String lastKnownClusterUUID
261263
) {
262264
int maxAttempts = 5;
263-
int delayInMills = 100;
265+
int delayInMills = 200;
264266
for (int attempt = 1; attempt <= maxAttempts; attempt++) {
265267
try {
268+
logger.info("Attempt {} to restore cluster state", attempt);
266269
return restoreClusterState(remoteStoreRestoreService, clusterState, lastKnownClusterUUID);
267270
} catch (Exception e) {
268271
if (attempt == maxAttempts) {

0 commit comments

Comments
 (0)