Skip to content

Commit edc4924

Browse files
authored
Add latch countdown on failure in CCR license tests (#33548)
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.
1 parent 9073dbe commit edc4924

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrLicenseIT.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public void testThatFollowingIndexIsUnavailableWithNonCompliantLicense() throws
4747
new ActionListener<AcknowledgedResponse>() {
4848
@Override
4949
public void onResponse(final AcknowledgedResponse response) {
50+
latch.countDown();
5051
fail();
5152
}
5253

@@ -69,6 +70,7 @@ public void testThatCreateAndFollowingIndexIsUnavailableWithNonCompliantLicense(
6970
new ActionListener<CreateAndFollowIndexAction.Response>() {
7071
@Override
7172
public void onResponse(final CreateAndFollowIndexAction.Response response) {
73+
latch.countDown();
7274
fail();
7375
}
7476

@@ -86,6 +88,7 @@ public void testThatCcrStatsAreUnavailableWithNonCompliantLicense() throws Inter
8688
client().execute(CcrStatsAction.INSTANCE, new CcrStatsAction.TasksRequest(), new ActionListener<CcrStatsAction.TasksResponse>() {
8789
@Override
8890
public void onResponse(final CcrStatsAction.TasksResponse tasksResponse) {
91+
latch.countDown();
8992
fail();
9093
}
9194

0 commit comments

Comments
 (0)