From 887421694c5cd54c360cc024ce55162ed5581213 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 9 Nov 2022 05:14:34 +0000 Subject: [PATCH] [Backport 2.x] Fix: org.opensearch.clustermanager.ClusterManagerTaskThrottlingIT is flaky. (#5153) * Fix: org.opensearch.clustermanager.ClusterManagerTaskThrottlingIT is flaky. (#5152) Signed-off-by: dblock Signed-off-by: dblock (cherry picked from commit 88757b4c3a2cd772527a8867957ca17e785629a4) Signed-off-by: github-actions[bot] * Fix race condition in testThrottlingForSingleNode. Signed-off-by: dblock Signed-off-by: dblock Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: dblock (cherry picked from commit 1cc50af10ab895acaaccd54ea2947efc54c8152f) Signed-off-by: github-actions[bot] --- .../clustermanager/ClusterManagerTaskThrottlingIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/clustermanager/ClusterManagerTaskThrottlingIT.java b/server/src/internalClusterTest/java/org/opensearch/clustermanager/ClusterManagerTaskThrottlingIT.java index 2f3f0539602dd..9817861c88e9a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/clustermanager/ClusterManagerTaskThrottlingIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/clustermanager/ClusterManagerTaskThrottlingIT.java @@ -116,8 +116,8 @@ public void testThrottlingForSingleNode() throws Exception { ActionListener listener = new ActionListener() { @Override public void onResponse(Object o) { - latch.countDown(); successfulRequest.incrementAndGet(); + latch.countDown(); } @Override @@ -164,9 +164,9 @@ public void onResponse(Object o) { @Override public void onFailure(Exception e) { + timedoutRequest.incrementAndGet(); latch.countDown(); assertTrue(e instanceof ProcessClusterEventTimeoutException); - timedoutRequest.incrementAndGet(); } }; executePutMappingRequests(totalRequest, node, listener);