Skip to content

Commit

Permalink
Do not print null method name in reproduce line (#41691)
Browse files Browse the repository at this point in the history
This commit updates the reproduce line that is printed out when a test
fails so that it does not output `.null` as the method name when the
failure is not a specific method but a class level issue such as
threads being leaked from the SUITE. Previously, when this occurred the
reproduce line would look like:

`./gradlew :server:integTest --tests "org.elasticsearch.indices.memory.breaker.CircuitBreakerServiceIT.null"`

and after this change, the line no longer contains the `.null` after
the class name.
  • Loading branch information
jaymode committed May 2, 2019
1 parent 0d97978 commit 8421e38
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ public void testFailure(Failure failure) throws Exception {
b.append(task);
b.append(" --tests \"");
b.append(failure.getDescription().getClassName());
b.append(".");
b.append(failure.getDescription().getMethodName());
final String methodName = failure.getDescription().getMethodName();
if (methodName != null) {
b.append(".");
b.append(failure.getDescription().getMethodName());
}
b.append("\"");

GradleMessageBuilder gradleMessageBuilder = new GradleMessageBuilder(b);
Expand Down

0 comments on commit 8421e38

Please sign in to comment.