Skip to content

Commit

Permalink
Try to make test failure more verbose.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Jun 17, 2020
1 parent 2255c3b commit b6a4da0
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.mockito.stubbing.Answer;

import java.io.*;
import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.Arrays;
Expand Down Expand Up @@ -126,6 +127,18 @@ public void run() {
try {
VirtualMachine.ForOpenJ9.attach(Integer.toString(PROCESS_ID), 5000, dispatcher).detach();
attachmentThread.join(5000);
} catch (RuntimeException exception) {
Throwable throwable = error.get();
if (throwable == null) {
throw exception;
} else {
try {
Throwable.class.getMethod("addSuppressed", Throwable.class).invoke(throwable, exception);
throw throwable;
} catch (NoSuchMethodException ignored) {
throw throwable;
}
}
} finally {
attachmentThread.interrupt();
}
Expand Down

0 comments on commit b6a4da0

Please sign in to comment.