Skip to content

Commit

Permalink
Fix flaky test under StartReplicationIT and ResumeReplicationIT
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Kumar <[email protected]>
  • Loading branch information
saikaranam-amazon committed Jan 13, 2022
1 parent 589417d commit 510eacd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 510eacd

Please sign in to comment.