From 5d97d8527206aa3319b1a00d6336b3dabd5dd0bd Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sun, 9 Sep 2018 07:24:57 -0400 Subject: [PATCH] Add latch countdown on failure in CCR license tests We have some listeners in the CCR license tests that invoke Assert#fail if the onSuccess method for the listener is unexpectedly invoked. This can leave the main test thread hanging until the test suite times out rather than failing quickly. This commit adds some latch countdowns so that we fail quickly if these cases are hit. --- .../test/java/org/elasticsearch/xpack/ccr/CcrLicenseIT.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrLicenseIT.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrLicenseIT.java index 05383b280e6ce..06cafc4777a49 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrLicenseIT.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrLicenseIT.java @@ -47,6 +47,7 @@ public void testThatFollowingIndexIsUnavailableWithNonCompliantLicense() throws new ActionListener() { @Override public void onResponse(final AcknowledgedResponse response) { + latch.countDown(); fail(); } @@ -69,6 +70,7 @@ public void testThatCreateAndFollowingIndexIsUnavailableWithNonCompliantLicense( new ActionListener() { @Override public void onResponse(final CreateAndFollowIndexAction.Response response) { + latch.countDown(); fail(); } @@ -86,6 +88,7 @@ public void testThatCcrStatsAreUnavailableWithNonCompliantLicense() throws Inter client().execute(CcrStatsAction.INSTANCE, new CcrStatsAction.TasksRequest(), new ActionListener() { @Override public void onResponse(final CcrStatsAction.TasksResponse tasksResponse) { + latch.countDown(); fail(); }