Skip to content

Commit

Permalink
Clear transient cluster setting at the end of the test
Browse files Browse the repository at this point in the history
Remove check of non zero assertion of time as it is non deterministic
Signed-off-by: Gaurav Bafna <[email protected]>
  • Loading branch information
gbbafna committed May 2, 2024
1 parent ef841dd commit 0a40e2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ public void testCreateCloneIndex() {
.cluster()
.prepareUpdateSettings()
.setTransientSettings(
Settings.builder().put(EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), (String) null)
Settings.builder()
.put(EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), (String) null)
.put(RecoverySettings.INDICES_INTERNAL_REMOTE_UPLOAD_TIMEOUT.getKey(), (String) null)
)
.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.opensearch.index.translog.transfer;

import org.apache.lucene.tests.util.LuceneTestCase;
import org.mockito.Mockito;
import org.opensearch.action.LatchedActionListener;
import org.opensearch.common.SetOnce;
import org.opensearch.common.blobstore.BlobContainer;
Expand Down Expand Up @@ -49,11 +50,6 @@
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;

import org.mockito.Mockito;

import static org.opensearch.index.remote.RemoteStoreEnums.DataCategory.TRANSLOG;
import static org.opensearch.index.remote.RemoteStoreEnums.DataType.METADATA;
import static org.opensearch.index.translog.transfer.TranslogTransferMetadata.METADATA_SEPARATOR;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.mockito.ArgumentMatchers.anySet;
Expand All @@ -64,6 +60,9 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.opensearch.index.remote.RemoteStoreEnums.DataCategory.TRANSLOG;
import static org.opensearch.index.remote.RemoteStoreEnums.DataType.METADATA;
import static org.opensearch.index.translog.transfer.TranslogTransferMetadata.METADATA_SEPARATOR;

@LuceneTestCase.SuppressFileSystems("*")
public class TranslogTransferManagerTests extends OpenSearchTestCase {
Expand Down Expand Up @@ -582,9 +581,7 @@ private void assertNoDownloadStats(boolean nonZeroUploadTime) {
assertEquals(0, remoteTranslogTransferTracker.getDownloadBytesSucceeded());
assertEquals(0, remoteTranslogTransferTracker.getTotalDownloadsSucceeded());
assertEquals(0, remoteTranslogTransferTracker.getLastSuccessfulDownloadTimestamp());
if (nonZeroUploadTime) {
assertNotEquals(0, remoteTranslogTransferTracker.getTotalDownloadTimeInMillis());
} else {
if (nonZeroUploadTime == false) {
assertEquals(0, remoteTranslogTransferTracker.getTotalDownloadTimeInMillis());
}
}
Expand Down

0 comments on commit 0a40e2e

Please sign in to comment.