From 89c6c27f7a2f303626e06ab347dc992a3f697adf Mon Sep 17 00:00:00 2001 From: Gaurav Bafna <85113518+gbbafna@users.noreply.github.com> Date: Fri, 3 May 2024 15:30:57 +0530 Subject: [PATCH] Clear transient cluster setting at the end of the test (#13508) Remove check of non zero assertion of time as it is non deterministic Signed-off-by: Gaurav Bafna --- .../action/admin/indices/create/RemoteCloneIndexIT.java | 4 +++- .../index/translog/transfer/TranslogTransferManagerTests.java | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/create/RemoteCloneIndexIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/create/RemoteCloneIndexIT.java index 98c2a3a1581b8..4be049c9a9109 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/create/RemoteCloneIndexIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/create/RemoteCloneIndexIT.java @@ -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(); } diff --git a/server/src/test/java/org/opensearch/index/translog/transfer/TranslogTransferManagerTests.java b/server/src/test/java/org/opensearch/index/translog/transfer/TranslogTransferManagerTests.java index 81ae479d018b0..8b3fc6651a505 100644 --- a/server/src/test/java/org/opensearch/index/translog/transfer/TranslogTransferManagerTests.java +++ b/server/src/test/java/org/opensearch/index/translog/transfer/TranslogTransferManagerTests.java @@ -582,9 +582,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()); } }