Ensure latch is counted down when assertion trips (#60800)
The ReloadSecureSettingsIT uses latches to ensure coordination across requests to the underlying in memory cluster. However, in the case of an expected failure, if the assertion fails, the latch will never be counted down, and will cause the test to hang indefinitely. This commit ensures the latch is always counted down with a try/finally. relates #51546
This commit is contained in:
parent
98119578a1
commit
fc38af363e
|
@ -175,10 +175,14 @@ public class ReloadSecureSettingsIT extends ESIntegTestCase {
|
|||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
assertThat(e, instanceOf(ElasticsearchException.class));
|
||||
assertThat(e.getMessage(),
|
||||
containsString("Secure settings cannot be updated cluster wide when TLS for the transport layer is not enabled"));
|
||||
latch.countDown();
|
||||
try {
|
||||
assertThat(e, instanceOf(ElasticsearchException.class));
|
||||
assertThat(e.getMessage(),
|
||||
containsString("Secure settings cannot be updated cluster wide when TLS for the " +
|
||||
"transport layer is not enabled"));
|
||||
} finally {
|
||||
latch.countDown();
|
||||
}
|
||||
}
|
||||
});
|
||||
latch.await();
|
||||
|
|
Loading…
Reference in New Issue