Skip to content

Commit

Permalink
Fix FullRollingRestartIT
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <kalsac@amazon.com>
  • Loading branch information
Sachin Kale committed Sep 4, 2023
1 parent 59d08b3 commit 65bc7cd
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ public void testFullRollingRestart() throws Exception {

final String healthTimeout = "1m";

for (int i = 0; i < 1000; i++) {
for (int i = 0; i < 100; i++) {
client().prepareIndex("test")
.setId(Long.toString(i))
.setSource(MapBuilder.<String, Object>newMapBuilder().put("test", "value" + i).map())
.execute()
.actionGet();
}
flush();
for (int i = 1000; i < 2000; i++) {
for (int i = 100; i < 200; i++) {
client().prepareIndex("test")
.setId(Long.toString(i))
.setSource(MapBuilder.<String, Object>newMapBuilder().put("test", "value" + i).map())
Expand Down Expand Up @@ -123,7 +123,7 @@ public void testFullRollingRestart() throws Exception {
logger.info("--> refreshing and checking data");
refresh();
for (int i = 0; i < 10; i++) {
assertHitCount(client().prepareSearch().setPreference("_primary").setSize(0).setQuery(matchAllQuery()).get(), 2000L);
assertHitCount(client().prepareSearch().setPreference("_primary").setSize(0).setQuery(matchAllQuery()).get(), 200L);
}

// now start shutting nodes down
Expand Down Expand Up @@ -156,7 +156,7 @@ public void testFullRollingRestart() throws Exception {
logger.info("--> stopped two nodes, verifying data");
refresh();
for (int i = 0; i < 10; i++) {
assertHitCount(client().prepareSearch().setPreference("_primary").setSize(0).setQuery(matchAllQuery()).get(), 2000L);
assertHitCount(client().prepareSearch().setPreference("_primary").setSize(0).setQuery(matchAllQuery()).get(), 200L);
}

// closing the 3rd node
Expand Down Expand Up @@ -190,7 +190,7 @@ public void testFullRollingRestart() throws Exception {
logger.info("--> one node left, verifying data");
refresh();
for (int i = 0; i < 10; i++) {
assertHitCount(client().prepareSearch().setPreference("_primary").setSize(0).setQuery(matchAllQuery()).get(), 2000L);
assertHitCount(client().prepareSearch().setPreference("_primary").setSize(0).setQuery(matchAllQuery()).get(), 200L);
}
}

Expand Down

0 comments on commit 65bc7cd

Please sign in to comment.