Skip to content

Commit 8b47967

Browse files
committed
Include unexpected output in exception message
1 parent f2aacfd commit 8b47967

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

qa/packaging/src/test/java/org/elasticsearch/packaging/test/EnrollmentProcessTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,11 @@ private String getEnrollmentToken() throws Exception {
148148
.toList();
149149

150150
if (filteredResult.size() > 1) {
151-
throw new AssertionError("Result from elasticsearch-create-enrollment-token contains unexpected output.");
151+
throw new AssertionError(
152+
"Result from elasticsearch-create-enrollment-token contains unexpected output. Output was: \n" + result.stdout()
153+
);
152154
} else if (filteredResult.isEmpty()) {
153-
throw new AssertionError("Failed to find any non-warning output lines");
155+
throw new AssertionError("Failed to find any non-warning output lines. Output was: \n" + result.stdout());
154156
}
155157

156158
enrollmentTokenHolder.set(filteredResult.getFirst());

0 commit comments

Comments
 (0)