From cd3d664bae369e5d8689f3023b39deea75957082 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 11 Sep 2024 15:19:12 +0100 Subject: [PATCH] Handle null exception message in `TestCluster#wipe` (#112741) Fixing noise seen in an unrelated test failure. --- .../src/main/java/org/elasticsearch/test/TestCluster.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/TestCluster.java b/test/framework/src/main/java/org/elasticsearch/test/TestCluster.java index ea632599fedbf..3385cb1eb2e7e 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/TestCluster.java +++ b/test/framework/src/main/java/org/elasticsearch/test/TestCluster.java @@ -36,6 +36,7 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.util.ArrayList; +import java.util.Objects; import java.util.Random; import java.util.Set; @@ -91,7 +92,7 @@ public void wipe(Set excludeTemplates) { l.delegateResponse((ll, e) -> { // Ignore if action isn't registered, because data streams is a module and // if the delete action isn't registered then there no data streams to delete. - if (e.getMessage().startsWith("failed to find action") == false) { + if (Objects.requireNonNullElse(e.getMessage(), "").startsWith("failed to find action") == false) { ll.onFailure(e); } else { ll.onResponse(AcknowledgedResponse.TRUE);