Skip to content

Commit 340d600

Browse files
committed
Log last exception in recovery cluster test
1 parent 532ad57 commit 340d600

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import java.nio.charset.StandardCharsets;
3636
import java.time.Duration;
3737
import java.time.Instant;
38-
import java.time.ZoneId;
3938
import java.time.format.DateTimeFormatter;
4039
import java.util.Collections;
4140
import java.util.LinkedHashMap;
@@ -255,9 +254,10 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru
255254
System.out.println(TestUtils.jsonPrettyPrint(environment.toString()));
256255

257256
LOGGER.info("Producer information:");
258-
producers.forEach(p -> {
259-
LOGGER.info("Producer to '{}' (last exception: '{}')", p.stream(), p.lastException);
260-
});
257+
producers.forEach(
258+
p -> {
259+
LOGGER.info("Producer to '{}' (last exception: '{}')", p.stream(), p.lastException);
260+
});
261261

262262
LOGGER.info("Closing producers");
263263
producers.forEach(
@@ -357,7 +357,9 @@ String lastException() {
357357
if (this.lastException.get() == null) {
358358
return "no exception";
359359
} else {
360-
return this.lastException.get().getMessage() + " at " + DateTimeFormatter.ISO_LOCAL_TIME.format(lastExceptionInstant.get());
360+
return this.lastException.get().getMessage()
361+
+ " at "
362+
+ DateTimeFormatter.ISO_INSTANT.format(lastExceptionInstant.get());
361363
}
362364
}
363365

0 commit comments

Comments
 (0)