From 83f7f4ebbf63c4277dce938964411753fd4ae32b Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 7 Jul 2017 21:15:05 +0200 Subject: [PATCH] slowCheck: don't print the same trace twice in a row while shrinking --- slowCheck/src/slowCheck/StatusNotifier.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/slowCheck/src/slowCheck/StatusNotifier.java b/slowCheck/src/slowCheck/StatusNotifier.java index 3af43d786c59..d9122682aa47 100644 --- a/slowCheck/src/slowCheck/StatusNotifier.java +++ b/slowCheck/src/slowCheck/StatusNotifier.java @@ -45,6 +45,7 @@ class StatusNotifier { } private int lastReportedStage = -1; + private String lastReportedTrace = null; void shrinkAttempt(PropertyFailure failure) { if (shouldPrint()) { int stage = failure.getMinimizationStageCount(); @@ -58,7 +59,11 @@ class StatusNotifier { Throwable exceptionCause = failure.getMinimalCounterexample().getExceptionCause(); if (exceptionCause != null) { - System.err.println(" Reason: " + shortenStackTrace(exceptionCause)); + String trace = shortenStackTrace(exceptionCause); + if (!trace.equals(lastReportedTrace)) { + lastReportedTrace = trace; + System.err.println(" Reason: " + trace); + } } System.err.println(); }