Skip to content

Commit

Permalink
Merge pull request #152 from Bukhtawar/remote-store-enabled-its
Browse files Browse the repository at this point in the history
Change action names to make tests work forcefully
  • Loading branch information
Bukhtawar authored Sep 2, 2023
2 parents eeecea6 + 393a7af commit daa07c4
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.opensearch.index.SegmentReplicationShardStats;
import org.opensearch.index.shard.IndexShard;
import org.opensearch.indices.IndicesService;
import org.opensearch.indices.recovery.PeerRecoverySourceService;
import org.opensearch.indices.recovery.PeerRecoveryTargetService;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.test.transport.MockTransportService;
import org.opensearch.transport.TransportService;
Expand Down Expand Up @@ -340,7 +342,13 @@ public void testRelocateWithQueuedOperationsDuringHandoff() throws Exception {
mockTargetTransportService.addSendBehavior(
internalCluster().getInstance(TransportService.class, primary),
(connection, requestId, action, request, options) -> {
if (action.equals(SegmentReplicationSourceService.Actions.GET_SEGMENT_FILES)) {
String actionToCheck = null;
try {
actionToCheck = isIndexRemoteStoreEnabled(INDEX_NAME) ? SegmentReplicationSourceService.Actions.GET_SEGMENT_FILES : PeerRecoverySourceService.Actions.START_RECOVERY;
} catch (Exception e) {
fail("Exception" + e);
}
if (action.equals(actionToCheck)) {
blockSegRepLatch.countDown();
try {
waitForIndexingLatch.await();
Expand Down Expand Up @@ -471,7 +479,13 @@ public void testAddNewReplicaFailure() throws Exception {
mockTransportService.addSendBehavior(
internalCluster().getInstance(TransportService.class, replica),
(connection, requestId, action, request, options) -> {
if (action.equals(SegmentReplicationTargetService.Actions.FILE_CHUNK)) {
String actionToCheck = null;
try {
actionToCheck = isIndexRemoteStoreEnabled(INDEX_NAME) ? SegmentReplicationTargetService.Actions.FILE_CHUNK : PeerRecoveryTargetService.Actions.FILE_CHUNK;
} catch (Exception e) {
fail("Exception "+ e);
}
if (action.equals(actionToCheck)) {
waitForRecovery.countDown();
throw new OpenSearchCorruptionException("expected");
}
Expand Down

0 comments on commit daa07c4

Please sign in to comment.