void (Failure failure, Description description, String messageName, String methodName) { final boolean isIgnored = MapSerializerUtil.TEST_IGNORED.equals(messageName); if (startedInParallel(description)) { TestEvent testEvent = myWaitingQueue.get(description); if (testEvent == null) { testEvent = new TestEvent(); myWaitingQueue.put(description, testEvent); } testEvent.setIgnored(isIgnored); testEvent.setFailure(failure); return; } Throwable ex = failure != null ? failure.getException() : null; if (ex != null && isMultipleFailuresError(ex.getClass())) { try { Object failures = Class.forName("org.opentest4j.MultipleFailuresError").getDeclaredMethod("getFailures").invoke(ex); //noinspection unchecked for (Throwable throwable : (List<Throwable>)failures) { testFailure(new Failure(description, throwable), description, messageName, methodName); } return; } catch (Throwable ignore) { } } final Map<String, String> attrs = new LinkedHashMap<>(); attrs.put("name", methodName); final long duration = currentTime() - myCurrentTestStart; if (duration > 0) { attrs.put("duration", Long.toString(duration)); } try { if (failure != null) { final String trace = getTrace(failure); final ComparisonFailureData notification = ExpectedPatterns.createExceptionNotification(ex); ComparisonFailureData.registerSMAttributes(notification, trace, failure.getMessage(), attrs, ex); } } catch (Throwable e) { final StringWriter stringWriter = new StringWriter(); final PrintWriter writer = new PrintWriter(stringWriter); e.printStackTrace(writer); ComparisonFailureData.registerSMAttributes(null, stringWriter.toString(), e.getMessage(), attrs, e); } finally { myPrintStream.println(MapSerializerUtil.asString(messageName, attrs)); } }