Skip to content

Commit

Permalink
Fixing flaky test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Rishav Sagar <rissag@amazon.com>
  • Loading branch information
Rishav Sagar committed Jan 20, 2023
1 parent f7dc32e commit e14d9dc
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void removeFilesystemProvider() {
}

// Increasing watermark limit to avoid flaky test case failures.
private static final long WATERMARK_BYTES = new ByteSizeValue(1, ByteSizeUnit.MB).getBytes();
private static final long WATERMARK_BYTES = new ByteSizeValue(10, ByteSizeUnit.KB).getBytes();
private static final String INDEX_ROUTING_ALLOCATION_NODE_SETTING = "index.routing.allocation.include._name";

@Override
Expand Down Expand Up @@ -208,7 +208,7 @@ public void testIndexCreateBlockWhenAllNodesExceededHighWatermark() throws Excep
StreamSupport.stream(clusterInfoService.getClusterInfo().getNodeLeastAvailableDiskUsages().values().spliterator(), false)
.allMatch(cur -> cur.value.getFreeBytes() < WATERMARK_BYTES)
);
}, 30L, TimeUnit.SECONDS);
}, 2L, TimeUnit.MINUTES);

// Validate if cluster block is applied on the cluster
ClusterState state = client().admin().cluster().prepareState().setLocal(true).get().getState();
Expand Down Expand Up @@ -252,7 +252,7 @@ public void testIndexCreateBlockIsRemovedWhenAnyNodesNotExceedHighWatermark() th
StreamSupport.stream(clusterInfoService.getClusterInfo().getNodeLeastAvailableDiskUsages().values().spliterator(), false)
.allMatch(cur -> cur.value.getFreeBytes() < WATERMARK_BYTES)
);
}, 30L, TimeUnit.SECONDS);
}, 2L, TimeUnit.MINUTES);

// Validate if index create block is applied on the cluster
ClusterState state = client().admin().cluster().prepareState().setLocal(true).get().getState();
Expand All @@ -266,7 +266,7 @@ public void testIndexCreateBlockIsRemovedWhenAnyNodesNotExceedHighWatermark() th
refreshDiskUsage();
ClusterState state1 = client().admin().cluster().prepareState().setLocal(true).get().getState();
assertFalse(state1.blocks().hasGlobalBlockWithId(Metadata.CLUSTER_CREATE_INDEX_BLOCK.id()));
}, 30L, TimeUnit.SECONDS);
}, 2L, TimeUnit.MINUTES);
}

public void testIndexCreateBlockWithAReadOnlyBlock() throws Exception {
Expand Down Expand Up @@ -298,7 +298,7 @@ public void testIndexCreateBlockWithAReadOnlyBlock() throws Exception {
StreamSupport.stream(clusterInfoService.getClusterInfo().getNodeLeastAvailableDiskUsages().values().spliterator(), false)
.allMatch(cur -> cur.value.getFreeBytes() < WATERMARK_BYTES)
);
}, 30L, TimeUnit.SECONDS);
}, 2L, TimeUnit.MINUTES);

// Validate index create block is applied on the cluster.
ClusterState state = client().admin().cluster().prepareState().setLocal(true).get().getState();
Expand Down

0 comments on commit e14d9dc

Please sign in to comment.