diff --git a/src/test/kotlin/org/opensearch/replication/integ/rest/ResumeReplicationIT.kt b/src/test/kotlin/org/opensearch/replication/integ/rest/ResumeReplicationIT.kt index 541b95ba..99ae2f79 100644 --- a/src/test/kotlin/org/opensearch/replication/integ/rest/ResumeReplicationIT.kt +++ b/src/test/kotlin/org/opensearch/replication/integ/rest/ResumeReplicationIT.kt @@ -171,7 +171,7 @@ class ResumeReplicationIT: MultiClusterRestTestCase() { followerClient.indices().getMapping(GetMappingsRequest().indices(followerIndexName), RequestOptions.DEFAULT) .mappings()[followerIndexName] ) - }, 5, TimeUnit.SECONDS) + }, 60L, TimeUnit.SECONDS) } finally { followerClient.stopReplication(followerIndexName) diff --git a/src/test/kotlin/org/opensearch/replication/integ/rest/StartReplicationIT.kt b/src/test/kotlin/org/opensearch/replication/integ/rest/StartReplicationIT.kt index 94d95bfa..e8548cd1 100644 --- a/src/test/kotlin/org/opensearch/replication/integ/rest/StartReplicationIT.kt +++ b/src/test/kotlin/org/opensearch/replication/integ/rest/StartReplicationIT.kt @@ -1066,18 +1066,19 @@ class StartReplicationIT: MultiClusterRestTestCase() { followerClient.pauseReplication(followerIndex2) followerClient.stopReplication(followerIndex3) - - val stats = followerClient.followerStats() - assertThat(stats.getValue("num_syncing_indices").toString()).isEqualTo("1") - assertThat(stats.getValue("num_paused_indices").toString()).isEqualTo("1") - assertThat(stats.getValue("num_failed_indices").toString()).isEqualTo("0") - assertThat(stats.getValue("num_shard_tasks").toString()).isEqualTo("1") - assertThat(stats.getValue("operations_written").toString()).isEqualTo("50") - assertThat(stats.getValue("operations_read").toString()).isEqualTo("50") - assertThat(stats.getValue("failed_read_requests").toString()).isEqualTo("0") - assertThat(stats.getValue("failed_write_requests").toString()).isEqualTo("0") - assertThat(stats.containsKey("index_stats")) - assertThat(stats.size).isEqualTo(16) + assertBusy({ + val stats = followerClient.followerStats() + assertThat(stats.getValue("num_syncing_indices").toString()).isEqualTo("1") + assertThat(stats.getValue("num_paused_indices").toString()).isEqualTo("1") + assertThat(stats.getValue("num_failed_indices").toString()).isEqualTo("0") + assertThat(stats.getValue("num_shard_tasks").toString()).isEqualTo("1") + assertThat(stats.getValue("operations_written").toString()).isEqualTo("50") + assertThat(stats.getValue("operations_read").toString()).isEqualTo("50") + assertThat(stats.getValue("failed_read_requests").toString()).isEqualTo("0") + assertThat(stats.getValue("failed_write_requests").toString()).isEqualTo("0") + assertThat(stats.containsKey("index_stats")) + assertThat(stats.size).isEqualTo(16) + }, 60L, TimeUnit.SECONDS) } finally { followerClient.stopReplication(followerIndexName) followerClient.stopReplication(followerIndex2)